├── common-libs ├── .nojekyll ├── docs │ ├── .nojekyll │ ├── utils │ │ └── assets │ │ │ └── images │ │ │ ├── icons.png │ │ │ ├── icons@2x.png │ │ │ ├── widgets.png │ │ │ └── widgets@2x.png │ └── index.html ├── packages │ ├── address.ts │ │ ├── example │ │ │ ├── index.ts │ │ │ ├── index.html │ │ │ └── types.d.ts │ │ ├── src │ │ │ ├── index.ts │ │ │ └── __test__ │ │ │ │ └── AddressParser.test.ts │ │ ├── tsconfig.test.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── .eslintrc.js │ │ ├── postcss.config.js │ │ ├── tsconfig.json │ │ ├── babel.config.js │ │ ├── tsconfig.es.json │ │ ├── types.d.ts │ │ ├── tsconfig.cjs.json │ │ ├── scripts │ │ │ └── webpack │ │ │ │ └── webpack.config.umd.js │ │ └── README.md │ ├── ts-types │ │ ├── example │ │ │ ├── index.html │ │ │ ├── index.ts │ │ │ └── types.d.ts │ │ ├── src │ │ │ ├── function │ │ │ │ ├── Constructor.ts │ │ │ │ ├── IsValidArg.ts │ │ │ │ └── Bind.ts │ │ │ ├── ramda │ │ │ │ ├── Compose.ts │ │ │ │ ├── ApplyFns.ts │ │ │ │ └── Pipe.ts │ │ │ ├── util │ │ │ │ ├── List.ts │ │ │ │ ├── Obj.ts │ │ │ │ ├── The.ts │ │ │ │ ├── NumObj.ts │ │ │ │ ├── Bool.ts │ │ │ │ ├── Intersection.ts │ │ │ │ ├── If.ts │ │ │ │ ├── Unknown.ts │ │ │ │ └── index.ts │ │ │ ├── object │ │ │ │ ├── Mutable.ts │ │ │ │ ├── Simplify.ts │ │ │ │ ├── ObjectValsToUnion.ts │ │ │ │ ├── Keyed.ts │ │ │ │ ├── StripIndex.ts │ │ │ │ ├── FunctionProps.ts │ │ │ │ ├── ObjectHasNumberIndex.ts │ │ │ │ ├── MatchingPropNames.ts │ │ │ │ ├── NonMatchingPropNames.ts │ │ │ │ ├── NonFunctionProps.ts │ │ │ │ ├── OptionalProps.ts │ │ │ │ ├── FunctionPropNames.ts │ │ │ │ ├── OptionalPropNames.ts │ │ │ │ ├── MatchingProps.ts │ │ │ │ ├── Prototype.ts │ │ │ │ ├── RequiredPropNames.ts │ │ │ │ ├── LiteralPropNames.ts │ │ │ │ ├── RequiredProps.ts │ │ │ │ ├── NonFunctionPropNames.ts │ │ │ │ ├── SpreadProps.ts │ │ │ │ ├── NonMatchingProps.ts │ │ │ │ ├── LiteralProps.ts │ │ │ │ ├── IntersectionObjectKeys.ts │ │ │ │ ├── Omit.ts │ │ │ │ ├── IntersectionObjects.ts │ │ │ │ ├── ObjectHasStringIndex.ts │ │ │ │ ├── DeconstructUnionHelper.ts │ │ │ │ ├── PrototypeHas.ts │ │ │ │ ├── ObjectHasElem.ts │ │ │ │ ├── IntersectValueOf.ts │ │ │ │ ├── KeyedSafe.ts │ │ │ │ ├── Dictionary.ts │ │ │ │ ├── ObjectHasKeySafe.ts │ │ │ │ ├── PrototypeMethods.ts │ │ │ │ ├── Swap.ts │ │ │ │ ├── ObjectHasKey.ts │ │ │ │ ├── ObjectNumberKeys.ts │ │ │ │ ├── DeepAssert.ts │ │ │ │ └── HasKey.ts │ │ │ ├── type │ │ │ │ ├── Matches.ts │ │ │ │ ├── Const.ts │ │ │ │ ├── Flatten.ts │ │ │ │ ├── PrototypeOf.ts │ │ │ │ ├── Widen.ts │ │ │ │ ├── TypesEqual.ts │ │ │ │ ├── Awaited.ts │ │ │ │ ├── InstanceOf.ts │ │ │ │ ├── Xor.ts │ │ │ │ └── DiscriminateUnion.ts │ │ │ ├── boolean │ │ │ │ ├── Falsy.ts │ │ │ │ ├── Not.ts │ │ │ │ ├── IsTruthy.ts │ │ │ │ ├── IsFalsy.ts │ │ │ │ ├── Or.ts │ │ │ │ ├── And.ts │ │ │ │ ├── DefinitelyYes.ts │ │ │ │ ├── Indeterminate.ts │ │ │ │ ├── DefinitelyNo.ts │ │ │ │ └── Determinate.ts │ │ │ ├── array │ │ │ │ ├── IsArrayType.ts │ │ │ │ ├── Tail.ts │ │ │ │ ├── ArrayProp.ts │ │ │ │ ├── TupleTail.ts │ │ │ │ ├── DifferenceTuples.ts │ │ │ │ ├── TupleProp.ts │ │ │ │ ├── IsTuple.ts │ │ │ │ ├── TupleHasIndex.ts │ │ │ │ ├── TupleFrom.ts │ │ │ │ ├── AppendNumObj.ts │ │ │ │ ├── ConcatNumObjs.ts │ │ │ │ ├── TupleTo.ts │ │ │ │ ├── TupleLastElem.ts │ │ │ │ └── FixedSizeArray.ts │ │ │ ├── union │ │ │ │ ├── UnionToObject.ts │ │ │ │ ├── IsUnion.ts │ │ │ │ ├── UnionToIntersection.ts │ │ │ │ ├── UnionHasKey.ts │ │ │ │ ├── UnionEmpty.ts │ │ │ │ ├── UnionsOverlap.ts │ │ │ │ └── UnionContained.ts │ │ │ ├── cast │ │ │ │ ├── ToBool.ts │ │ │ │ ├── ListToNumObj.ts │ │ │ │ ├── NumObjToList.ts │ │ │ │ ├── TupleToUnion.ts │ │ │ │ └── TupleIndicesToUnion.ts │ │ │ ├── tuple │ │ │ │ ├── LengthList.ts │ │ │ │ ├── Unshift.ts │ │ │ │ ├── ListTail.ts │ │ │ │ ├── Prepend.ts │ │ │ │ └── DifferenceLists.ts │ │ │ ├── comp │ │ │ │ ├── Max.ts │ │ │ │ ├── Min.ts │ │ │ │ ├── StringsEqual.ts │ │ │ │ ├── Gt.ts │ │ │ │ ├── Lt.ts │ │ │ │ ├── Gte.ts │ │ │ │ ├── Lte.ts │ │ │ │ ├── index.ts │ │ │ │ └── NumbersEqual.ts │ │ │ ├── number │ │ │ │ ├── Subtract.ts │ │ │ │ ├── Add.ts │ │ │ │ ├── Dec.ts │ │ │ │ ├── Modulo.ts │ │ │ │ ├── Mult.ts │ │ │ │ ├── DivFloor.ts │ │ │ │ └── Pow.ts │ │ │ └── index.ts │ │ ├── tsconfig.test.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── .eslintrc.js │ │ ├── postcss.config.js │ │ ├── tsconfig.json │ │ ├── babel.config.js │ │ ├── tsconfig.es.json │ │ ├── types.d.ts │ │ ├── tsconfig.cjs.json │ │ ├── scripts │ │ │ └── webpack │ │ │ │ └── webpack.config.umd.js │ │ └── README.md │ ├── ts-utils │ │ ├── example │ │ │ ├── index.html │ │ │ ├── index.ts │ │ │ └── types.d.ts │ │ ├── src │ │ │ ├── ds │ │ │ │ ├── __test__ │ │ │ │ │ ├── number.test.ts │ │ │ │ │ ├── array.test.ts │ │ │ │ │ └── datetime.test.ts │ │ │ │ ├── index.ts │ │ │ │ └── datetime │ │ │ │ │ └── index.ts │ │ │ ├── network │ │ │ │ └── index.ts │ │ │ ├── env │ │ │ │ ├── __test__ │ │ │ │ │ └── server.test.ts │ │ │ │ ├── index.ts │ │ │ │ └── i18n.ts │ │ │ ├── shim.d.ts │ │ │ ├── func │ │ │ │ ├── promise-pool │ │ │ │ │ └── README.md │ │ │ │ ├── index.ts │ │ │ │ ├── log.ts │ │ │ │ └── __test__ │ │ │ │ │ ├── EventEmitter.test.ts │ │ │ │ │ └── throttle.test.ts │ │ │ ├── bom │ │ │ │ └── index.ts │ │ │ ├── types │ │ │ │ ├── basic │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── Primitive.ts │ │ │ │ │ └── ObservableLike.ts │ │ │ │ └── utils │ │ │ │ │ └── index.ts │ │ │ ├── dom │ │ │ │ ├── index.ts │ │ │ │ └── __test__ │ │ │ │ │ └── element.test.ts │ │ │ └── index.ts │ │ ├── .eslintrc.js │ │ ├── tsconfig.test.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── .eslintignore │ │ ├── postcss.config.js │ │ ├── babel.config.js │ │ ├── tsconfig.es.json │ │ ├── types.d.ts │ │ ├── tsconfig.cjs.json │ │ ├── scripts │ │ │ └── webpack │ │ │ │ └── webpack.config.umd.js │ │ └── tsconfig.json │ ├── animation-effect │ │ ├── example │ │ │ ├── index.html │ │ │ ├── index.ts │ │ │ └── types.d.ts │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── widget │ │ │ │ └── index.ts │ │ │ ├── particle │ │ │ │ ├── index.ts │ │ │ │ └── fireworks │ │ │ │ │ └── global.d.ts │ │ │ └── animate │ │ │ │ ├── motion.ts │ │ │ │ └── index.ts │ │ ├── tsconfig.test.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── .eslintrc.js │ │ ├── postcss.config.js │ │ ├── tsconfig.json │ │ ├── babel.config.js │ │ ├── tsconfig.es.json │ │ ├── types.d.ts │ │ ├── tsconfig.cjs.json │ │ └── scripts │ │ │ └── webpack │ │ │ └── webpack.config.umd.js │ ├── state-management │ │ ├── example │ │ │ ├── index.html │ │ │ ├── index.ts │ │ │ └── types.d.ts │ │ ├── tsconfig.test.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── .eslintrc.js │ │ ├── src │ │ │ ├── index.ts │ │ │ └── vanilla │ │ │ │ └── __test__ │ │ │ │ └── proxy.test.ts │ │ ├── postcss.config.js │ │ ├── tsconfig.json │ │ ├── babel.config.js │ │ ├── tsconfig.es.json │ │ ├── types.d.ts │ │ ├── tsconfig.cjs.json │ │ └── scripts │ │ │ └── webpack │ │ │ └── webpack.config.umd.js │ ├── style-preset │ │ ├── scss │ │ │ ├── _variables.scss │ │ │ ├── utilities │ │ │ │ └── _color.scss │ │ │ ├── custom-style │ │ │ │ └── _responsive-menu.scss │ │ │ └── msp.scss │ │ ├── css │ │ │ └── reset.css │ │ └── less │ │ │ └── mixins │ │ │ ├── title.less │ │ │ ├── textarea.less │ │ │ ├── image.less │ │ │ └── label.less │ ├── typed-entity-decorators │ │ ├── example │ │ │ └── index.ts │ │ ├── src │ │ │ ├── decorator-x │ │ │ │ ├── flow │ │ │ │ │ └── README.md │ │ │ │ ├── types │ │ │ │ │ └── index.d.ts │ │ │ │ ├── src │ │ │ │ │ ├── internal │ │ │ │ │ │ └── types.js │ │ │ │ │ ├── index.util.js │ │ │ │ │ └── index.web.js │ │ │ │ ├── .npmignore │ │ │ │ ├── demo │ │ │ │ │ ├── entity │ │ │ │ │ │ ├── blog │ │ │ │ │ │ │ ├── Comment.js │ │ │ │ │ │ │ └── Post.js │ │ │ │ │ │ └── auth │ │ │ │ │ │ │ └── UserProperty.js │ │ │ │ │ ├── app.js │ │ │ │ │ └── controller │ │ │ │ │ │ └── AnnouncementControllerDoc.js │ │ │ │ ├── .babelrc │ │ │ │ ├── .flowconfig │ │ │ │ ├── flow-typed │ │ │ │ │ └── modules.js │ │ │ │ └── test │ │ │ │ │ ├── swagger │ │ │ │ │ └── swagger.test.js │ │ │ │ │ └── transform │ │ │ │ │ └── entity │ │ │ │ │ └── flow │ │ │ │ │ └── TestEntity.js │ │ │ ├── decorator │ │ │ │ └── index.ts │ │ │ ├── misc │ │ │ │ ├── const.ts │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── context │ │ │ │ ├── index.ts │ │ │ │ └── ConstantFactory.ts │ │ ├── tsconfig.test.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── .eslintrc.js │ │ ├── postcss.config.js │ │ ├── tsconfig.json │ │ ├── babel.config.js │ │ ├── tsconfig.es.json │ │ ├── types.d.ts │ │ ├── tsconfig.cjs.json │ │ └── scripts │ │ │ └── webpack │ │ │ └── webpack.config.umd.js │ ├── google-translate │ │ ├── .gitattributes │ │ └── .eslintrc.yml │ ├── redux-middlewares │ │ ├── .eslintignore │ │ ├── src │ │ │ ├── pack-fsa │ │ │ │ ├── typings.d.ts │ │ │ │ ├── index.ts │ │ │ │ └── constants.ts │ │ │ ├── throttle │ │ │ │ ├── typings.d.ts │ │ │ │ ├── index.ts │ │ │ │ ├── README.md │ │ │ │ └── constants.ts │ │ │ └── debounced │ │ │ │ ├── typings.d.ts │ │ │ │ ├── index.ts │ │ │ │ └── constants.ts │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.test.json │ │ ├── scripts │ │ │ ├── jest │ │ │ │ └── jest.config.js │ │ │ └── webpack │ │ │ │ └── webpack.config.umd.js │ │ ├── tsconfig.cjs.json │ │ ├── .vscode │ │ │ └── setting.json │ │ └── tsconfig.es.json │ ├── react-commons │ │ ├── postcss.config.js │ │ ├── src │ │ │ ├── hocs │ │ │ │ └── index.ts │ │ │ ├── env │ │ │ │ └── index.ts │ │ │ ├── components │ │ │ │ ├── ellipsis │ │ │ │ │ └── index.ts │ │ │ │ ├── Exception │ │ │ │ │ ├── SimpleException.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── containers │ │ │ │ │ └── index.ts │ │ │ │ ├── auth │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.ts │ │ │ │ └── PageLoading │ │ │ │ │ └── index.tsx │ │ │ ├── shim.d.ts │ │ │ ├── types │ │ │ │ ├── index.ts │ │ │ │ └── module.ts │ │ │ └── index.ts │ │ ├── .eslintrc.js │ │ ├── .prettierrc.js │ │ ├── .storybook │ │ │ ├── addons.js │ │ │ ├── config.js │ │ │ └── webpack.config.js │ │ ├── example │ │ │ ├── types.d.ts │ │ │ ├── index.tsx │ │ │ └── Simple │ │ │ │ └── index.tsx │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── scripts │ │ │ ├── jest │ │ │ │ └── jest.config.js │ │ │ └── webpack │ │ │ │ ├── webpack.config.dev.js │ │ │ │ └── webpack.config.umd.js │ │ ├── tsconfig.json │ │ ├── .eslintignore │ │ ├── tsconfig.cjs.json │ │ ├── README.md │ │ ├── babel.config.js │ │ ├── .vscode │ │ │ └── setting.json │ │ ├── tsconfig.es.json │ │ └── stories │ │ │ └── index.stories.tsx │ ├── ts-plugible │ │ ├── .eslintrc.js │ │ ├── .prettierrc.js │ │ ├── .eslintignore │ │ ├── babel.config.js │ │ └── .vscode │ │ │ └── setting.json │ ├── ts-async │ │ ├── .mocharc.json │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── .gitignore │ │ ├── tsconfig.es6.json │ │ ├── tsconfig.mjs.json │ │ ├── src │ │ │ ├── errors.ts │ │ │ └── index.ts │ │ └── test │ │ │ ├── semaphore.ts │ │ │ └── util.ts │ └── ts-color │ │ └── src │ │ └── color │ │ └── public_api.ts ├── .huskyrc.js ├── .lintstagedrc.js ├── .postcssrc.js ├── jsconfig.json ├── .prettierrc.js ├── .prettierignore ├── tsconfig.test.json ├── scripts │ ├── docker │ │ └── Dockerfile.local │ ├── jest │ │ └── jest.config.js │ └── tools │ │ ├── upgrade_pkgs.sh │ │ └── lint_pkgs.sh ├── .eslintignore ├── .editorconfig ├── .gitignore ├── .eslintrc.js ├── .vscode │ └── setting.json └── tsconfig.json ├── common-configs ├── packages │ ├── vite-config │ │ ├── .gitignore │ │ ├── example │ │ │ ├── src │ │ │ │ ├── variables.less │ │ │ │ ├── App.module.less │ │ │ │ ├── components │ │ │ │ │ └── Counter.module.less │ │ │ │ ├── typing.d.ts │ │ │ │ ├── main.tsx │ │ │ │ └── index.css │ │ │ ├── .gitignore │ │ │ ├── vite.config.js │ │ │ ├── tsconfig.json │ │ │ └── index.html │ │ └── tsconfig.json │ ├── webpack-config │ │ ├── .gitignore │ │ ├── example-node │ │ │ ├── typing.d.ts │ │ │ ├── .gitignore │ │ │ ├── index.ts │ │ │ ├── tsconfig.json │ │ │ └── webpack.config.js │ │ ├── .postcssrc.js │ │ ├── example │ │ │ ├── tsconfig.json │ │ │ ├── src │ │ │ │ ├── index.less │ │ │ │ └── index.tsx │ │ │ ├── public │ │ │ │ ├── favicon.ico │ │ │ │ └── manifest.json │ │ │ ├── typing.d.ts │ │ │ ├── scripts │ │ │ │ └── webpack │ │ │ │ │ ├── webpack.config.umd.js │ │ │ │ │ ├── webpack.config.dev.js │ │ │ │ │ └── webpack.config.prod.js │ │ │ └── .gitignore │ │ └── babel.config.js │ ├── webpack4-config │ │ ├── .gitignore │ │ ├── example-node │ │ │ ├── typing.d.ts │ │ │ ├── .gitignore │ │ │ ├── index.ts │ │ │ ├── tsconfig.json │ │ │ └── webpack.config.js │ │ ├── example │ │ │ ├── tsconfig.json │ │ │ ├── src │ │ │ │ ├── index.less │ │ │ │ └── index.tsx │ │ │ ├── public │ │ │ │ ├── favicon.ico │ │ │ │ └── manifest.json │ │ │ ├── typing.d.ts │ │ │ ├── scripts │ │ │ │ └── webpack │ │ │ │ │ ├── webpack.config.dev.js │ │ │ │ │ ├── webpack.config.umd.js │ │ │ │ │ └── webpack.config.prod.js │ │ │ └── .gitignore │ │ └── babel.config.js │ ├── jest-config │ │ ├── styleMock.js │ │ ├── fileMock.js │ │ ├── jest.setup.js │ │ └── jest-puppeteer.config.js │ ├── prettier-config │ │ ├── .prettierignore │ │ ├── index.js │ │ ├── .prettierrc.js │ │ ├── semi │ │ │ ├── index.js │ │ │ ├── vue.js │ │ │ ├── quote.js │ │ │ └── angular.js │ │ ├── quote.js │ │ ├── vue.js │ │ ├── next.js │ │ └── angular.js │ ├── rollup-config │ │ ├── index.js │ │ └── module.js │ ├── babel-preset │ │ └── config.js │ ├── tsconfig │ │ ├── .prettierrc.js │ │ ├── composite.json │ │ ├── node.json │ │ ├── loose.json │ │ ├── jsconfig.json │ │ ├── lib.json │ │ ├── app.json │ │ └── dist │ │ │ ├── main.js │ │ │ └── main.js.map │ ├── browserslist-config │ │ ├── modern.js │ │ ├── index.js │ │ ├── latest.js │ │ └── package.json │ ├── eslint-config │ │ ├── .prettierrc.js │ │ └── recommended.js │ ├── lint-staged │ │ ├── ts-tslint.json │ │ ├── ts-eslint.json │ │ └── tsc.js │ ├── stylelint-config │ │ ├── index.js │ │ ├── modules.js │ │ ├── tests │ │ │ └── test.less │ │ └── scss │ │ │ └── loose.js │ ├── husky-config │ │ └── index.js │ ├── tslint-config │ │ ├── eslint.json │ │ ├── react.json │ │ └── angular.json │ ├── remark-config │ │ └── index.js │ └── postcss-config │ │ └── tailwind.config.js ├── .gitignore ├── tests │ ├── _test.ts │ ├── test.css │ ├── test.md │ ├── mdx.png │ ├── alauda.png │ ├── test.mdx │ ├── test.spec.js │ ├── test.jsx │ ├── test.tsx │ ├── test.scss │ ├── test.less │ └── test.d.ts ├── .browserslistrc ├── .huskyrc.js ├── .lintstagedrc.js ├── .remarkrc ├── .prettierrc.js ├── jest.config.js ├── tslint.json ├── rollup.config.js ├── .editorconfig ├── pnpm-workspace.yaml ├── stylelint.common.js ├── tsconfig.json ├── codechecks.yml ├── scripts │ ├── upgrade_pkgs.sh │ └── publish_pkgs.sh ├── babel.config.js └── .eslintrc.js ├── common-scaffold ├── node-cli │ ├── scripts │ │ ├── tools │ │ │ ├── publish_pkgs.sh │ │ │ ├── lint_all.sh │ │ │ └── upgrade_pkgs.sh │ │ ├── docker │ │ │ ├── Dockerfile.local │ │ │ ├── Dockerfile.gitlab │ │ │ └── start-container.sh │ │ └── jest │ │ │ └── jest.config.js │ ├── .huskyrc.js │ ├── .lintstagedrc.js │ ├── .postcssrc.js │ ├── jsconfig.json │ ├── packages │ │ └── mfs-cli │ │ │ ├── .eslintrc.js │ │ │ ├── tslint.json │ │ │ ├── tsconfig.json │ │ │ ├── tsconfig.test.json │ │ │ ├── src │ │ │ ├── func │ │ │ │ ├── __test__ │ │ │ │ │ └── sum.test.ts │ │ │ │ └── sum.ts │ │ │ ├── utils │ │ │ │ └── log.ts │ │ │ ├── index.ts │ │ │ ├── registry │ │ │ │ └── Registry.ts │ │ │ └── constant │ │ │ │ └── types.ts │ │ │ ├── scripts │ │ │ ├── jest │ │ │ │ └── jest.config.js │ │ │ └── webpack │ │ │ │ └── webpack.config.umd.js │ │ │ ├── .eslintignore │ │ │ ├── tsconfig.cjs.json │ │ │ ├── tsconfig.es.json │ │ │ ├── .vscode │ │ │ └── setting.json │ │ │ └── babel.config.js │ ├── .dockerignore │ ├── .prettierignore │ ├── tsconfig.test.json │ ├── .eslintignore │ ├── .editorconfig │ ├── .gitignore │ ├── .eslintrc.js │ ├── .vscode │ │ └── setting.json │ └── tsconfig.json ├── docs-generator │ ├── .dockerignore │ ├── docs │ │ ├── exampledoc5.md │ │ ├── exampledoc4.md │ │ └── doc2.md │ ├── website │ │ ├── static │ │ │ └── img │ │ │ │ ├── favicon.ico │ │ │ │ └── oss_logo.png │ │ ├── sidebars.json │ │ ├── blog │ │ │ ├── 2017-09-26-adding-rss.md │ │ │ └── 2017-10-24-new-version-1.0.0.md │ │ └── package.json │ ├── Dockerfile │ └── .gitignore ├── go-code-generator │ ├── transform │ │ └── go.mod │ ├── templates │ │ ├── react.webapp │ │ │ ├── .env.production │ │ │ ├── .env.development │ │ │ ├── src │ │ │ │ ├── tech │ │ │ │ │ └── Tech.css │ │ │ │ ├── index.js │ │ │ │ ├── setupTests.js │ │ │ │ ├── index.css │ │ │ │ └── App.test.js │ │ │ └── public │ │ │ │ ├── robots.txt │ │ │ │ ├── favicon.ico │ │ │ │ ├── logo192.png │ │ │ │ └── logo512.png │ │ ├── .dockerignore │ │ ├── vue.webapp │ │ │ ├── .env.production │ │ │ ├── .env.development │ │ │ ├── babel.config.js │ │ │ ├── public │ │ │ │ └── favicon.ico │ │ │ └── src │ │ │ │ └── main.js │ │ ├── angular.webapp │ │ │ ├── src │ │ │ │ ├── robots.txt │ │ │ │ ├── app │ │ │ │ │ ├── tech │ │ │ │ │ │ ├── tech.model.ts │ │ │ │ │ │ └── tech.component.html │ │ │ │ │ ├── app.component.scss │ │ │ │ │ └── app.component.ts │ │ │ │ ├── environments │ │ │ │ │ └── environment.prod.ts │ │ │ │ ├── favicon.ico │ │ │ │ ├── index.html │ │ │ │ └── main.ts │ │ │ ├── e2e │ │ │ │ ├── tsconfig.json │ │ │ │ └── src │ │ │ │ │ └── app.po.ts │ │ │ ├── .editorconfig │ │ │ ├── tsconfig.app.json │ │ │ └── tsconfig.spec.json │ │ ├── server │ │ │ ├── go.mod │ │ │ └── model │ │ │ │ └── technology.go │ │ ├── .gitignore │ │ ├── docker-compose-dev.yml │ │ ├── Dockerfile │ │ └── docker-compose.yml │ ├── go.mod │ └── main.go └── .github │ └── ISSUE_TEMPLATE │ └── custom.md └── .github └── ISSUE_TEMPLATE └── custom.md /common-libs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/example/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/example/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/example/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/example/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/example/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/example/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/example/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/example/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/example/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/example/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/scripts/tools/publish_pkgs.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-configs/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | lib 3 | node_modules 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example-node/typing.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/scss/utilities/_color.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/ds/__test__/number.test.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/example/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example-node/typing.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-configs/packages/jest-config/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example-node/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example-node/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /common-configs/tests/_test.ts: -------------------------------------------------------------------------------- 1 | export const content = 'Hello World' 2 | -------------------------------------------------------------------------------- /common-libs/packages/google-translate/.gitattributes: -------------------------------------------------------------------------------- 1 | *.* text eol=lf 2 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | scripts/ -------------------------------------------------------------------------------- /common-scaffold/docs-generator/.dockerignore: -------------------------------------------------------------------------------- 1 | */node_modules 2 | *.log 3 | -------------------------------------------------------------------------------- /common-configs/.browserslistrc: -------------------------------------------------------------------------------- 1 | extends @m-fe/browserslist-config 2 | >0% 3 | -------------------------------------------------------------------------------- /common-configs/.huskyrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/husky-config'); 2 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/.prettierignore: -------------------------------------------------------------------------------- 1 | .npmrc 2 | .yarnrc 3 | -------------------------------------------------------------------------------- /common-libs/.huskyrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/husky-config'); 2 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/flow/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/types/index.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-configs/.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/lint-staged'); 2 | -------------------------------------------------------------------------------- /common-libs/.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/lint-staged'); 2 | -------------------------------------------------------------------------------- /common-libs/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/postcss-config'); 2 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './animate'; 2 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/network/index.ts: -------------------------------------------------------------------------------- 1 | export * from './axios'; 2 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/src/internal/types.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-configs/packages/jest-config/fileMock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub'; 2 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./base'); 2 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/src/variables.less: -------------------------------------------------------------------------------- 1 | @primaryColor: white; 2 | -------------------------------------------------------------------------------- /common-libs/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@m-fe/tsconfig/jsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/hocs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './reactable'; 2 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/transform/go.mod: -------------------------------------------------------------------------------- 1 | module transform 2 | 3 | go 1.14 4 | -------------------------------------------------------------------------------- /common-configs/.remarkrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@m-fe/remark-config" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /common-configs/packages/rollup-config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/cjs')() 2 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/src/widget/index.ts: -------------------------------------------------------------------------------- 1 | export * from './WaterMark'; 2 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../.eslintrc.js") -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/pack-fsa/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'deline'; 2 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/throttle/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'deline'; 2 | -------------------------------------------------------------------------------- /common-libs/packages/ts-plugible/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../.eslintrc.js") -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator/index.ts: -------------------------------------------------------------------------------- 1 | export * from './di'; 2 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/.env.production: -------------------------------------------------------------------------------- 1 | REACT_APP_API_URL= -------------------------------------------------------------------------------- /common-scaffold/node-cli/.huskyrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@wx-fc/husky-config'); 2 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@wx-fc/lint-staged'); 2 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@wx-fc/postcss-config'); 2 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../.eslintrc.js") -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/debounced/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'deline'; 2 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/env/__test__/server.test.ts: -------------------------------------------------------------------------------- 1 | describe('server', () => {}); 2 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/shpota/goxygen 2 | 3 | go 1.14 4 | -------------------------------------------------------------------------------- /common-configs/packages/babel-preset/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@m-fe'], 3 | }; 4 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/.dockerignore: -------------------------------------------------------------------------------- 1 | webapp/node_modules/ 2 | webapp/build/ 3 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@wx-fc/tsconfig/jsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../.eslintrc.js") -------------------------------------------------------------------------------- /common-configs/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('@m-fe/prettier-config/semi'), 3 | }; 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/postcss-config'); 2 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /common-libs/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('@m-fe/prettier-config/semi'), 3 | }; 4 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/src/particle/index.ts: -------------------------------------------------------------------------------- 1 | export * from './fireworks/P5Fireworks'; 2 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/.npmignore: -------------------------------------------------------------------------------- 1 | 2 | # 将 dist 目录整体打包发布 3 | !dist/ -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/misc/const.ts: -------------------------------------------------------------------------------- 1 | export const MetadataKey = 'ted-meta'; 2 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tslint.json"] 3 | } 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example-node/index.ts: -------------------------------------------------------------------------------- 1 | const a: number = 2; 2 | 3 | console.log(a); 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example-node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example-node/index.ts: -------------------------------------------------------------------------------- 1 | const a: number = 2; 2 | 3 | console.log(a); 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /common-configs/tests/test.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | a { 6 | color: red; 7 | } 8 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/env/index.ts: -------------------------------------------------------------------------------- 1 | export * from './sw-notify'; 2 | export * from './theme'; 3 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/shim.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'url-parse'; 2 | declare module 'parse-domain'; 3 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/.env.development: -------------------------------------------------------------------------------- 1 | REACT_APP_API_URL=http://localhost:8080 -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/vue.webapp/.env.production: -------------------------------------------------------------------------------- 1 | NODE_ENV=production 2 | VUE_APP_API_URL= -------------------------------------------------------------------------------- /common-scaffold/node-cli/scripts/docker/Dockerfile.local: -------------------------------------------------------------------------------- 1 | FROM abiosoft/caddy 2 | COPY . /srv 3 | EXPOSE 2015 4 | -------------------------------------------------------------------------------- /common-configs/packages/rollup-config/module.js: -------------------------------------------------------------------------------- 1 | import config from './config' 2 | 3 | export default config() 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example-node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /common-configs/tests/test.md: -------------------------------------------------------------------------------- 1 | # Title 2 | 3 | My _Content_: [link][] 4 | 5 | [link]: https://www.micro-frontend 6 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/scss/custom-style/_responsive-menu.scss: -------------------------------------------------------------------------------- 1 | //http://codepen.io/wxyyxc1992/pen/EgyBvd -------------------------------------------------------------------------------- /common-scaffold/node-cli/scripts/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@wx-fc/jest-config/jest.config'); 2 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('../../.prettierrc.js'), 3 | }; 4 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /common-configs/tests/mdx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-configs/tests/mdx.png -------------------------------------------------------------------------------- /common-libs/packages/react-commons/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('../../.prettierrc.js'), 3 | }; 4 | -------------------------------------------------------------------------------- /common-libs/packages/ts-plugible/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('../../.prettierrc.js'), 3 | }; 4 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/function/Constructor.ts: -------------------------------------------------------------------------------- 1 | export type Constructor = new (...args: unknown[]) => T; 2 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/misc/index.ts: -------------------------------------------------------------------------------- 1 | export * from './const'; 2 | export * from './error'; 3 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('../../.prettierrc.js'), 3 | }; 4 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/semi/index.js: -------------------------------------------------------------------------------- 1 | module.exports = Object.assign({}, require('..'), { semi: true }); 2 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/semi/vue.js: -------------------------------------------------------------------------------- 1 | module.exports = Object.assign({}, require('../vue'), { semi: true }); 2 | -------------------------------------------------------------------------------- /common-configs/tests/alauda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-configs/tests/alauda.png -------------------------------------------------------------------------------- /common-libs/.prettierignore: -------------------------------------------------------------------------------- 1 | !/.vscode/settings.json 2 | *.min.* 3 | *.production.* 4 | coverage 5 | dist 6 | node_modules 7 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/debounced/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants'; 2 | export * from './middleware'; 3 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/throttle/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants'; 2 | export * from './middleware'; 3 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/docs/exampledoc5.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: doc5 3 | title: Fifth Document 4 | --- 5 | 6 | Another one 7 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/src/tech/Tech.css: -------------------------------------------------------------------------------- 1 | .technologies { 2 | margin-top: 5px; 3 | } 4 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.dockerignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.tsbuildinfo 3 | .cache 4 | .vscode 5 | coverage 6 | dist 7 | node_modules 8 | -------------------------------------------------------------------------------- /common-configs/packages/browserslist-config/modern.js: -------------------------------------------------------------------------------- 1 | module.exports = require('.').concat(['not ie <= 11', 'not ie_mob <= 11']); 2 | -------------------------------------------------------------------------------- /common-configs/packages/eslint-config/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('@m-fe/prettier-config/semi'), 3 | }; 4 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/quote.js: -------------------------------------------------------------------------------- 1 | module.exports = Object.assign({}, require('./base'), { singleQuote: false }); 2 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/semi/quote.js: -------------------------------------------------------------------------------- 1 | module.exports = Object.assign({}, require('../quote'), { semi: true }); 2 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/src/App.module.less: -------------------------------------------------------------------------------- 1 | .logo { 2 | height: 40vmin; 3 | pointer-events: none; 4 | } 5 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/src/animate/motion.ts: -------------------------------------------------------------------------------- 1 | // https://github.com/sveltejs/svelte/tree/master/src/runtime/motion 2 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/vue.webapp/.env.development: -------------------------------------------------------------------------------- 1 | NODE_ENV=development 2 | VUE_APP_API_URL=http://localhost:8080 -------------------------------------------------------------------------------- /common-configs/packages/lint-staged/ts-tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "!(*.d).ts?(x)": [ 3 | "tslint -p . -t stylish --fix" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/semi/angular.js: -------------------------------------------------------------------------------- 1 | module.exports = Object.assign({}, require('../angular'), { semi: true }); 2 | -------------------------------------------------------------------------------- /common-configs/tests/test.mdx: -------------------------------------------------------------------------------- 1 | # Title 2 | 3 |
Header
4 |
Main
5 | 6 | Inline 7 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["src/**/*"] 4 | } 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/ramda/Compose.ts: -------------------------------------------------------------------------------- 1 | // type Compose any>> = Pipe>; 2 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/List.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * shorter `ArrayLike` alias 3 | */ 4 | export type List = ArrayLike; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/func/promise-pool/README.md: -------------------------------------------------------------------------------- 1 | # promise-pool 2 | 3 | - https://github.com/supercharge/promise-pool 4 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["src/**/*"] 4 | } 5 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/scripts/tools/lint_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | (cd ./packages/mfs-cli && yarn lint) 5 | 6 | 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": "ts-node/register", 3 | "reporter": "spec", 4 | "ui": "tdd" 5 | } 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[typescript]": { 3 | "editor.formatOnSave": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/demo/entity/blog/Comment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by apple on 2017/7/25. 3 | */ 4 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/demo/entity/blog/Post.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by apple on 2017/7/25. 3 | */ 4 | -------------------------------------------------------------------------------- /common-libs/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/docs/exampledoc4.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: doc4 3 | title: Other Document 4 | --- 5 | 6 | this is another document 7 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/vite.config.js: -------------------------------------------------------------------------------- 1 | const { genConfig } = require('../'); 2 | 3 | module.exports = genConfig(__dirname); 4 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/throttle/README.md: -------------------------------------------------------------------------------- 1 | # Redux Middleware Throttle 2 | 3 | Redux middleware to throttle your actions. 4 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.prettierignore: -------------------------------------------------------------------------------- 1 | !/.vscode/settings.json 2 | *.min.* 3 | *.production.* 4 | coverage 5 | dist 6 | node_modules 7 | *.yml 8 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/scripts/tools/upgrade_pkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | ncu -u 5 | 6 | (cd ./packages/mfs-cli && ncu -u) 7 | 8 | -------------------------------------------------------------------------------- /common-configs/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest/presets/js-with-babel', 3 | testRegex: [/.*\.(spec|test)\.[jt]sx?$/], 4 | } 5 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AddressData'; 2 | export * from './AddressParser'; 3 | export * from './AreaParser'; 4 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/.storybook/addons.js: -------------------------------------------------------------------------------- 1 | import '@storybook/addon-actions/register'; 2 | import '@storybook/addon-links/register'; 3 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/components/ellipsis/index.ts: -------------------------------------------------------------------------------- 1 | export * from './FixedLengthEllipsis'; 2 | export * from './FixedWidthEllipsis'; 3 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../.eslintrc.js'); 2 | 3 | module.exports = { 4 | ...baseConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './decorator'; 2 | export * from './context'; 3 | export * from './misc'; 4 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/server/go.mod: -------------------------------------------------------------------------------- 1 | module project-name 2 | 3 | go 1.14 4 | 5 | require go.mongodb.org/mongo-driver v1.3.0 6 | -------------------------------------------------------------------------------- /common-configs/packages/stylelint-config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [require.resolve('./base'), 'stylelint-prettier/recommended'], 3 | }; 4 | -------------------------------------------------------------------------------- /common-libs/docs/utils/assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/docs/utils/assets/images/icons.png -------------------------------------------------------------------------------- /common-libs/packages/address.ts/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/src/animate/index.ts: -------------------------------------------------------------------------------- 1 | export * from './animation'; 2 | export * from './easing'; 3 | export * from './transition'; 4 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/example/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/shim.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'webpack-theme-color-replacer/client'; 2 | declare module 'dayjs-ext/plugin/timeZone'; 3 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/pack-fsa/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants'; 2 | export * from './middleware'; 3 | export * from './handle'; 4 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/Mutable.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Remove `readonly`. 3 | */ 4 | export type Mutable = { -readonly [P in keyof T]: T[P] }; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /common-libs/scripts/docker/Dockerfile.local: -------------------------------------------------------------------------------- 1 | FROM abiosoft/caddy 2 | COPY . /srv 3 | RUN find . -name '*.map' -type f -exec rm -f {} \; 4 | EXPOSE 2015 5 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/src/components/Counter.module.less: -------------------------------------------------------------------------------- 1 | @import '../variables.less'; 2 | 3 | .count { 4 | color: @primaryColor; 5 | } 6 | -------------------------------------------------------------------------------- /common-libs/docs/utils/assets/images/icons@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/docs/utils/assets/images/icons@2x.png -------------------------------------------------------------------------------- /common-libs/docs/utils/assets/images/widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/docs/utils/assets/images/widgets.png -------------------------------------------------------------------------------- /common-libs/packages/address.ts/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/packages/address.ts/public/favicon.ico -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/debounced/constants.ts: -------------------------------------------------------------------------------- 1 | export interface FsaAction { 2 | type: string; 3 | payload: any; 4 | meta: any; 5 | } 6 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /common-libs/packages/ts-types/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/packages/ts-types/public/favicon.ico -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/Obj.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A shorthand to make homogeneous object types. 3 | */ 4 | export type Obj = { [k: string]: T }; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/packages/ts-utils/public/favicon.ico -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/vue.webapp/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /common-configs/packages/lint-staged/ts-eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx}": [ 3 | "cross-env PARSER_NO_WATCH=true eslint --cache -f friendly --fix" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /common-configs/packages/lint-staged/tsc.js: -------------------------------------------------------------------------------- 1 | module.exports = Object.assign({}, require('.'), { 2 | '*.ts?(x)': () => 'tsc --incremental false --noEmit', 3 | }); 4 | -------------------------------------------------------------------------------- /common-libs/docs/utils/assets/images/widgets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/docs/utils/assets/images/widgets@2x.png -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/The.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * inspired by Idris language, an operator to asssert a type 3 | */ 4 | export type The = V; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/bom/index.ts: -------------------------------------------------------------------------------- 1 | export * from './cookie'; 2 | export * from './file'; 3 | export * from './history'; 4 | export * from './media'; 5 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/app/tech/tech.model.ts: -------------------------------------------------------------------------------- 1 | export interface Technology { 2 | name: string; 3 | details: string; 4 | } 5 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/src/index.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .a { 4 | background: url(./assets/X.svg); 5 | } 6 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/src/index.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .a { 4 | background: url(./assets/X.svg); 5 | } 6 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/packages/react-commons/public/favicon.ico -------------------------------------------------------------------------------- /common-libs/packages/react-commons/scripts/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../../scripts/jest/jest.config'); 2 | 3 | module.exports = baseConfig; 4 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './comp'; 2 | export * from './model'; 3 | export * from './module'; 4 | export * from './props'; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/Matches.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Check if a type matches another (`<=`). 3 | */ 4 | export type Matches = V extends T ? '1' : '0'; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/NumObj.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A shorthand to make numerically indexed object types. 3 | */ 4 | export type NumObj = { [k: number]: T }; 5 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/src/index.util.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | export { flowToDecoratorPlugin } from "./transform/entity/flow/flow"; 4 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common-libs/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/packages/animation-effect/public/favicon.ico -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/scripts/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../../scripts/jest/jest.config'); 2 | 3 | module.exports = baseConfig; 4 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/packages/state-management/public/favicon.ico -------------------------------------------------------------------------------- /common-libs/packages/ts-async/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | es6 4 | mjs 5 | index.mjs 6 | coverage 7 | .nyc_output 8 | package.lock 9 | .vscode/launch.json 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/Simplify.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Simplify an object type to strip out intersections. 3 | */ 4 | export type Simplify = Pick; 5 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | apiUrl: '' 4 | }; 5 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/src/func/__test__/sum.test.ts: -------------------------------------------------------------------------------- 1 | import { sum } from '../sum'; 2 | 3 | test('sum', () => { 4 | expect(sum(1, 2)).toBe(3); 5 | }); 6 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/src/utils/log.ts: -------------------------------------------------------------------------------- 1 | export function logError(...args: object[]) { 2 | // tslint:disable-next-line 3 | console.log(...args); 4 | } 5 | -------------------------------------------------------------------------------- /common-configs/packages/eslint-config/recommended.js: -------------------------------------------------------------------------------- 1 | const { overrides } = require('./overrides'); 2 | 3 | module.exports = { 4 | extends: ['@m-fe'], 5 | overrides, 6 | }; 7 | -------------------------------------------------------------------------------- /common-configs/tests/test.spec.js: -------------------------------------------------------------------------------- 1 | describe('Name of the group', () => { 2 | it('should just work', () => { 3 | expect(typeof describe).not.toBe('undefined') 4 | }) 5 | }) 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/Falsy.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Any types considered falsy in JS, 3 | */ 4 | export type Falsy = undefined | null | 0 | '' | false | void | never; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/ObjectValsToUnion.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get the values of an object type as a union. 3 | */ 4 | export type ObjectValsToUnion = O[keyof O]; 5 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/scripts/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../../scripts/jest/jest.config'); 2 | 3 | module.exports = baseConfig; 4 | -------------------------------------------------------------------------------- /common-configs/tests/test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default class Test extends React.PureComponent { 4 | render() { 5 | return
Hello
6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common-configs/tests/test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default class Test extends React.PureComponent { 4 | render() { 5 | return
Hello
6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/types/basic/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Class'; 2 | export * from './ObservableLike'; 3 | export * from './Primitive'; 4 | export * from './TypedArray'; 5 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/website/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-scaffold/docs-generator/website/static/img/favicon.ico -------------------------------------------------------------------------------- /common-scaffold/docs-generator/website/static/img/oss_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-scaffold/docs-generator/website/static/img/oss_logo.png -------------------------------------------------------------------------------- /common-configs/packages/husky-config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | hooks: { 3 | 'pre-commit': 'lint-staged', 4 | 'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS', 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-configs/packages/webpack-config/example/public/favicon.ico -------------------------------------------------------------------------------- /common-configs/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@m-fe/tslint-config/react", "tslint-config-eslint/prettier"], 3 | "linterOptions": { 4 | "exclude": ["node_modules/**"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const baseConfig = require('../../.eslintrc.js'); 4 | 5 | module.exports = { 6 | ...baseConfig, 7 | }; 8 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react" 4 | }, 5 | "extends": "../../tsconfig.json", 6 | "include": ["src/**/*"] 7 | } 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const baseConfig = require('../../.eslintrc.js'); 4 | 5 | module.exports = { 6 | ...baseConfig, 7 | }; 8 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-libs/packages/typed-entity-decorators/public/favicon.ico -------------------------------------------------------------------------------- /common-scaffold/node-cli/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/src/typing.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.svg'; 7 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/typing.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.svg'; 7 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-configs/packages/webpack4-config/example/public/favicon.ico -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/typing.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.svg'; 7 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | export * from './env'; 3 | export * from './hocs'; 4 | export * from './polyfills'; 5 | export * from './types'; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-plugible/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /common-configs/packages/tslint-config/eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tslint", 3 | "extends": [ 4 | "./tslint.json", 5 | "tslint-config-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const baseConfig = require('../../.eslintrc.js'); 4 | 5 | module.exports = { 6 | ...baseConfig, 7 | }; 8 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const baseConfig = require('../../.eslintrc.js'); 4 | 5 | module.exports = { 6 | ...baseConfig, 7 | }; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/env/index.ts: -------------------------------------------------------------------------------- 1 | export * from './browser'; 2 | export * from './compatibility'; 3 | export * from './i18n'; 4 | export * from './mobile'; 5 | export * from './server'; 6 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/server/model/technology.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Technology struct { 4 | Name string `json:"name"` 5 | Details string `json:"details"` 6 | } 7 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/composite.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tsconfig", 3 | "extends": "./lib.json", 4 | "compilerOptions": { 5 | "composite": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/node.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tsconfig", 3 | "extends": "./lib.json", 4 | "compilerOptions": { 5 | "module": "commonjs" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/Keyed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Use an object type to make an object type using its keys as both keys and values. 3 | */ 4 | export type Keyed = { [K in keyof T]: K }; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/StripIndex.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Strip an object type of its string index. 3 | */ 4 | export type StripIndex = { [P in keyof T]: string extends P ? never : T[P] }; 5 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const baseConfig = require('../../.eslintrc.js'); 4 | 5 | module.exports = { 6 | ...baseConfig, 7 | }; 8 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constant/types'; 2 | export { sum } from './func/sum'; 3 | export * from './utils/log'; 4 | 5 | export const library = 'rtwCore'; 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/components/Exception/SimpleException.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export const SimpleException = ({ ...args }) =>
Simple Exception
; 4 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/dom/index.ts: -------------------------------------------------------------------------------- 1 | export * from './element/Element'; 2 | export * from './element/utils'; 3 | export * from './event'; 4 | export * from './script'; 5 | export * from './style'; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/types/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Except'; 2 | export * from './Merge'; 3 | export * from './Mutable'; 4 | export * from './PartialDeep'; 5 | export * from './Simplify'; 6 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/context/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ApplicationContext'; 2 | export * from './BeanFactory'; 3 | export * from './ConstantFactory'; 4 | export * from './Scanner'; 5 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.exe~ 3 | *.dll 4 | *.so 5 | *.dylib 6 | *.test 7 | *.out 8 | 9 | webapp/node_modules 10 | webapp/build 11 | webapp/npm-debug.log* 12 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-scaffold/go-code-generator/templates/angular.webapp/src/favicon.ico -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-scaffold/go-code-generator/templates/react.webapp/public/favicon.ico -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-scaffold/go-code-generator/templates/react.webapp/public/logo192.png -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-scaffold/go-code-generator/templates/react.webapp/public/logo512.png -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/vue.webapp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/m-fe-commons/master/common-scaffold/go-code-generator/templates/vue.webapp/public/favicon.ico -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/src/func/sum.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 计算两个值之和 3 | * @param num1 4 | * @param num2 5 | */ 6 | export function sum(num1: number, num2: number) { 7 | return num1 + num2; 8 | } 9 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge'); 2 | 3 | module.exports = merge(require('../webpack-base/webpack.config').umdConfig, {}); 4 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | demo 14 | 15 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/components/Exception/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Exception403'; 2 | export * from './Exception404'; 3 | export * from './Exception500'; 4 | export * from './SimpleException'; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/postcss.config.js: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | 3 | module.exports = { 4 | plugins: [autoprefixer({ browsers: ['last 4 versions'], flexbox: 'no-2009' })] 5 | }; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/postcss.config.js: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | 3 | module.exports = { 4 | plugins: [autoprefixer({ browsers: ['last 4 versions'], flexbox: 'no-2009' })] 5 | }; 6 | -------------------------------------------------------------------------------- /common-libs/scripts/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('@m-fe/jest-config/jest.config'); 2 | 3 | module.exports = { 4 | ...baseConfig, 5 | testEnvironment: 'jest-environment-jsdom-sixteen', 6 | }; 7 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/app/tech/tech.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • 3 | {{tech.name}}: {{tech.details}} 4 |
  • 5 |
6 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/scripts/webpack/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | 3 | module.exports = merge(require('../webpack-base/webpack.config').devConfig, {}); 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/scripts/webpack/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | 3 | module.exports = merge(require('../webpack-base/webpack.config').devConfig, {}); 4 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge'); 2 | 3 | module.exports = merge(require('../webpack-base/webpack.config').umdConfig, {}); 4 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/postcss.config.js: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | 3 | module.exports = { 4 | plugins: [autoprefixer({ browsers: ['last 4 versions'], flexbox: 'no-2009' })] 5 | }; 6 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/src/index.ts: -------------------------------------------------------------------------------- 1 | import { useProxy } from './react/useProxy'; 2 | import { proxy, snapshot, subscribe } from './vanilla/proxy'; 3 | 4 | export { proxy, subscribe, snapshot, useProxy }; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/IsArrayType.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | /** 4 | * Check whether a type is an array type 5 | */ 6 | export type IsArrayType = Matches; 7 | -------------------------------------------------------------------------------- /common-configs/packages/tslint-config/react.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tslint", 3 | "extends": [ 4 | "./tslint.json", 5 | "tslint-react", 6 | "tslint-config-prettier" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /common-configs/rollup.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | 3 | import config from './packages/rollup-config/config' 4 | 5 | export default config({ 6 | input: path.resolve('packages/rollup-config/config.js'), 7 | }) 8 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/postcss.config.js: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | 3 | module.exports = { 4 | plugins: [autoprefixer({ browsers: ['last 4 versions'], flexbox: 'no-2009' })] 5 | }; 6 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/components/containers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './IntervalComponent'; 2 | export * from './LoadableContainer'; 3 | export * from './PromiseComp'; 4 | export * from './SuspenseContainer'; 5 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "dist/cjs", 6 | "declaration": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "dist/cjs", 6 | "declaration": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/postcss.config.js: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | 3 | module.exports = { 4 | plugins: [autoprefixer({ browsers: ['last 4 versions'], flexbox: 'no-2009' })] 5 | }; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/tsconfig.es6.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "es6", 6 | "declaration": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /common-scaffold/.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/docs/doc2.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: doc2 3 | title: document number 2 4 | --- 5 | 6 | This is a link to [another document.](doc3.md) 7 | This is a link to an [external page.](http://www.example.com) 8 | -------------------------------------------------------------------------------- /common-configs/packages/jest-config/jest.setup.js: -------------------------------------------------------------------------------- 1 | require('jest-fetch-mock'); 2 | 3 | const { configure } = require('enzyme'); 4 | const Adapter = require('enzyme-adapter-react-16'); 5 | configure({ adapter: new Adapter() }); 6 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/README.md: -------------------------------------------------------------------------------- 1 | # react-commons 2 | 3 | react-commons 是对应用开发过程中的常见组件进行抽取,以 CJS/UMD 形式发布。 4 | 5 | # About 6 | 7 | ## Acknowledgements 8 | 9 | - [hooks](https://github.com/alibaba/hooks) 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/Not.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from '../util/Bool'; 2 | 3 | /** 4 | * Inverts a string-based boolean (`'0'` / `'1'`). 5 | */ 6 | export type Not = { '1': '0'; '0': '1' }[T]; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/FunctionProps.ts: -------------------------------------------------------------------------------- 1 | import { MatchingProps } from './MatchingProps'; 2 | 3 | /** 4 | * Get all function properties. 5 | */ 6 | export type FunctionProps = MatchingProps; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/ObjectHasNumberIndex.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Check whether an object has a number index. 3 | */ 4 | export type ObjectHasNumberIndex = T extends { [i: number]: any } 5 | ? '1' 6 | : '0'; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/Bool.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A string-based boolean analog. Used in type-level conditionals, 3 | * especially as a way to simultaneously enable recursion. 4 | */ 5 | export type Bool = '0' | '1'; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/ds/__test__/array.test.ts: -------------------------------------------------------------------------------- 1 | import { chunkWithFill } from '../array'; 2 | 3 | describe('chunk', () => { 4 | it('chunkWithFill', () => { 5 | chunkWithFill(['1'], 2, '1'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/postcss.config.js: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | 3 | module.exports = { 4 | plugins: [autoprefixer({ browsers: ['last 4 versions'], flexbox: 'no-2009' })] 5 | }; 6 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "dist/cjs", 6 | "declaration": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | tab_width = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/components/auth/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './authority'; 2 | export * from './Authorized'; 3 | export * from './AuthorizedRoute'; 4 | export * from './permissions'; 5 | export * from './withAuth'; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/tsconfig.mjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.es6.json", 3 | "compilerOptions": { 4 | "target": "es6", 5 | "outDir": "mjs", 6 | "importHelpers": false, 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/MatchingPropNames.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get all property names matching a type. 3 | */ 4 | export type MatchingPropNames = { 5 | [K in keyof T]: T[K] extends X ? K : never; 6 | }[keyof T]; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './bom'; 2 | export * from './dom'; 3 | export * from './ds'; 4 | export * from './env'; 5 | export * from './func'; 6 | export * from './network'; 7 | export * from './types'; 8 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts 2 | 3 | WORKDIR /app/website 4 | 5 | EXPOSE 3000 35729 6 | COPY ./docs /app/docs 7 | COPY ./website /app/website 8 | RUN yarn install 9 | 10 | CMD ["yarn", "start"] 11 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/vue.webapp/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | Vue.config.productionTip = false 5 | 6 | new Vue({ 7 | render: h => h(App), 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /common-configs/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | tab_width = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/scripts/webpack/webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | 3 | module.exports = merge( 4 | require('../webpack-base/webpack.config').prodConfig, 5 | {}, 6 | ); 7 | -------------------------------------------------------------------------------- /common-libs/.gitignore: -------------------------------------------------------------------------------- 1 | # Node files 2 | node_modules 3 | 4 | # OS junk files 5 | .DS_Store 6 | .stylelintcache 7 | .eslintcache 8 | 9 | # Project specific stuff 10 | .cache-loader 11 | @coverage 12 | *.log 13 | dist 14 | build 15 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/example/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import * as ReactDOM from 'react-dom'; 3 | 4 | import Simple from './Simple'; 5 | 6 | ReactDOM.render(, document.getElementById('root')); 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/IsTruthy.ts: -------------------------------------------------------------------------------- 1 | import { IsFalsy } from './IsFalsy'; 2 | import { Not } from './Not'; 3 | 4 | /** 5 | * Checks whether a type literal is truthy. 6 | */ 7 | export type IsTruthy = Not>; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/ramda/ApplyFns.ts: -------------------------------------------------------------------------------- 1 | // type ApplyFns any>, V> = { 2 | // '1': Fs['length'] extends 0 ? V : ApplyFns, Fs[0](V)> 3 | // }[V extends number ? '1' : '1']; 4 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/Intersection.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * just make an intersection type -- this wrapper helps to beat error 3 | * `Type ... does not satisfy the constraint ...` 4 | */ 5 | export type Intersection = A & B; 6 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/scripts/webpack/webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | 3 | module.exports = merge( 4 | require('../webpack-base/webpack.config').prodConfig, 5 | {}, 6 | ); 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/NonMatchingPropNames.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get all property names not matching a type. 3 | */ 4 | export type NonMatchingPropNames = { 5 | [K in keyof T]: T[K] extends X ? never : K; 6 | }[keyof T]; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "resolveJsonModule": true, 5 | "downlevelIteration": true 6 | }, 7 | "include": ["src/**/*", "example/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /common-configs/pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | # the root package.json 3 | - '.' 4 | # all packages in subdirs of packages/ and components/ 5 | - 'packages/**' 6 | # exclude packages that are inside test/ directories 7 | - '!**/test/**' -------------------------------------------------------------------------------- /common-libs/packages/address.ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "resolveJsonModule": true, 5 | "downlevelIteration": true 6 | }, 7 | "include": ["src/**/*", "example/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/Tail.ts: -------------------------------------------------------------------------------- 1 | /** Get all but the first element of a tuple. */ 2 | export type Tail = ((...args: T) => any) extends ( 3 | head: any, 4 | ...tail: infer R 5 | ) => any 6 | ? R 7 | : never; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/NonFunctionProps.ts: -------------------------------------------------------------------------------- 1 | import { NonMatchingProps } from './NonMatchingProps'; 2 | 3 | /** 4 | * Get all non-function properties. 5 | */ 6 | export type NonFunctionProps = NonMatchingProps; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/union/UnionToObject.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Use a union of string literals to make an object using those 3 | * strings as both keys and values. 4 | */ 5 | export type UnionToObject = { [K in Keys]: K }; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/ds/__test__/datetime.test.ts: -------------------------------------------------------------------------------- 1 | import { getCurrentWeekDates } from '../datetime'; 2 | 3 | describe('weekly', () => { 4 | it('get weekly info', () => { 5 | console.log(getCurrentWeekDates()); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | tab_width = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/loose.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "strictFunctionTypes": false, 6 | "strictNullChecks": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /common-configs/stylelint.common.js: -------------------------------------------------------------------------------- 1 | const config = require('@m-fe/stylelint-config'); 2 | 3 | module.exports = { 4 | ...config, 5 | rules: { 6 | ...config.rules, 7 | 'plugin/no-unsupported-browser-features': null, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "resolveJsonModule": true, 5 | "downlevelIteration": true 6 | }, 7 | "include": ["src/**/*", "example/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "resolveJsonModule": true, 5 | "downlevelIteration": true 6 | }, 7 | "include": ["src/**/*", "example/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/example/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/IsFalsy.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | import { Falsy } from './Falsy'; 4 | 5 | /** 6 | * Checks whether a type literal is falsy. 7 | */ 8 | export type IsFalsy = Matches; 9 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/cast/ToBool.ts: -------------------------------------------------------------------------------- 1 | import { IsTruthy } from '../boolean/IsTruthy'; 2 | 3 | /** 4 | * Converts a type to a string bool, analogous to `Boolean` or `!!`. 5 | * @deprecated 6 | */ 7 | export type ToBool = IsTruthy; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/OptionalProps.ts: -------------------------------------------------------------------------------- 1 | import { OptionalPropNames } from './OptionalPropNames'; 2 | 3 | /** 4 | * Get all properties that include undefined. 5 | */ 6 | export type OptionalProps = Pick>; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/Const.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Return the first of two types, aka the kestrel combinator. 3 | * @see https://hackage.haskell.org/package/data-aviary-0.4.0/docs/Data-Aviary-Birds.html 4 | */ 5 | export type Const = A; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/example/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.gitignore: -------------------------------------------------------------------------------- 1 | # Node files 2 | node_modules 3 | 4 | # OS junk files 5 | .DS_Store 6 | .stylelintcache 7 | .eslintcache 8 | 9 | # Project specific stuff 10 | .cache-loader 11 | @coverage 12 | *.log 13 | dist 14 | build 15 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/example/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true 9 | } 10 | ] 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/scss/msp.scss: -------------------------------------------------------------------------------- 1 | @import "utilities/family"; 2 | @import "utilities/media-query"; 3 | @import "utilities/color"; 4 | @import "mobile-reset"; 5 | @import "utilities"; 6 | @import "layout"; 7 | @import "custom-style/custom-style"; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-plugible/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/FunctionPropNames.ts: -------------------------------------------------------------------------------- 1 | import { MatchingPropNames } from './MatchingPropNames'; 2 | 3 | /** 4 | * Get all property names holding functions. 5 | */ 6 | export type FunctionPropNames = MatchingPropNames; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/OptionalPropNames.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get all names of properties with types that include undefined. 3 | */ 4 | export type OptionalPropNames = { 5 | [K in keyof T]: undefined extends T[K] ? K : never; 6 | }[keyof T]; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "resolveJsonModule": true, 5 | "downlevelIteration": true 6 | }, 7 | "include": ["src/**/*", "example/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import {App} from './App'; 5 | 6 | ReactDOM.render(, document.getElementById('root')); 7 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "emitDecoratorMetadata": true, 4 | "experimentalDecorators": true, 5 | "baseUrl": ".", 6 | "paths": { 7 | "@/*": ["./src/*"] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /common-libs/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '@m-fe/eslint-config/base', 3 | parserOptions: { 4 | ecmaVersion: 2018, 5 | sourceType: 'module', 6 | project: './tsconfig.json', 7 | tsconfigRootDir: __dirname, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/example/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { "language": "typescript", "autoFix": true }, 6 | { "language": "typescriptreact", "autoFix": true } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/example/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/MatchingProps.ts: -------------------------------------------------------------------------------- 1 | import { MatchingPropNames } from './MatchingPropNames'; 2 | 3 | /** 4 | * Get all properties with names matching a type. 5 | */ 6 | export type MatchingProps = Pick>; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/Prototype.ts: -------------------------------------------------------------------------------- 1 | import { PrototypeMethods } from './PrototypeMethods'; 2 | 3 | /** 4 | * Object of keys used to access prototype methods in object types. 5 | */ 6 | export type Prototype = { [K in PrototypeMethods]: K }; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/RequiredPropNames.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get all names of properties with types that don't include undefined. 3 | */ 4 | export type RequiredPropNames = { 5 | [K in keyof T]: undefined extends T[K] ? never : K; 6 | }[keyof T]; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/Flatten.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Flatten a structure of nested tuples/arrays into a flat element type. 3 | */ 4 | export type Flatten = { 5 | '1': Flatten ? U : T>; 6 | }[T extends number ? '1' : '1']; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/dom/__test__/element.test.ts: -------------------------------------------------------------------------------- 1 | import { element } from '../element/utils'; 2 | 3 | describe('create', () => { 4 | it('element', () => { 5 | const $a = element('a'); 6 | expect($a.tagName).toEqual('A'); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | node_modules 4 | 5 | lib/core/metadata.js 6 | lib/core/MetadataBlog.js 7 | 8 | website/translated_docs 9 | website/build/ 10 | website/yarn.lock 11 | website/node_modules 12 | website/i18n/* 13 | -------------------------------------------------------------------------------- /common-configs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./packages/tsconfig/tsconfig.json", // for type-coverage 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "jsx": "preserve", 6 | "noEmit": true 7 | }, 8 | "exclude": ["node_modules"] 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { "language": "typescript", "autoFix": true }, 6 | { "language": "typescriptreact", "autoFix": true } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/LiteralPropNames.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get all property names that are literals, i.e. all but the (string) index. 3 | */ 4 | export type LiteralPropNames = { 5 | [K in keyof T]: string extends T[K] ? never : K; 6 | }[keyof T]; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/RequiredProps.ts: -------------------------------------------------------------------------------- 1 | import { RequiredPropNames } from './RequiredPropNames'; 2 | 3 | /** 4 | * Get all properties with types that don't include undefined. 5 | */ 6 | export type RequiredProps = Pick>; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/tuple/LengthList.ts: -------------------------------------------------------------------------------- 1 | import { List } from '../util/List'; 2 | 3 | /** 4 | * Returns the length of a numerically indexed type with explicit `length`, e.g. tuple. 5 | */ 6 | export type LengthList> = R['length']; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/PrototypeOf.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get the prototype (-> methods) of a type. 3 | * `Partial` helps for e.g. tuple types if not object types, 4 | * though `Symbol`-based keys get killed. 5 | */ 6 | // export type PrototypeOf = ... 7 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-configs/packages/browserslist-config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | 'defaults', 3 | // 'current node', // disable temporarily, see https://github.com/amilajack/eslint-plugin-compat/issues/264 4 | 'last 5 versions', 5 | 'not dead', 6 | '>0.5% in CN', 7 | ]; 8 | -------------------------------------------------------------------------------- /common-configs/packages/browserslist-config/latest.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | 'last 1 Android version', 3 | 'last 1 Chrome version', 4 | 'last 1 ChromeAndroid version', 5 | 'last 1 FireFox version', 6 | 'last 1 iOS version', 7 | 'last 1 Safari version', 8 | ]; 9 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "declaration": true, 6 | "declarationMap": true, 7 | "outDir": "dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Node files 2 | node_modules 3 | 4 | # OS junk files 5 | .DS_Store 6 | .stylelintcache 7 | .eslintcache 8 | 9 | # Project specific stuff 10 | .cache-loader 11 | @coverage 12 | *.log 13 | dist 14 | build 15 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Node files 2 | node_modules 3 | 4 | # OS junk files 5 | .DS_Store 6 | .stylelintcache 7 | .eslintcache 8 | 9 | # Project specific stuff 10 | .cache-loader 11 | @coverage 12 | *.log 13 | dist 14 | build 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/ArrayProp.ts: -------------------------------------------------------------------------------- 1 | import { List } from '../util/List'; 2 | 3 | /** 4 | * Get the element of an array-like type. 5 | * @param R array type 6 | * @returns its element type 7 | */ 8 | export type ArrayProp> = R[-1]; 9 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/website/sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": { 3 | "Docusaurus": ["doc1"], 4 | "First Category": ["doc2"], 5 | "Second Category": ["doc3"] 6 | }, 7 | "docs-other": { 8 | "First Category": ["doc4", "doc5"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/src/errors.ts: -------------------------------------------------------------------------------- 1 | export const E_TIMEOUT = new Error('timeout while waiting for mutex to become available'); 2 | export const E_ALREADY_LOCKED = new Error('mutex already locked'); 3 | export const E_CANCELED = new Error('request for lock canceled'); 4 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/NonFunctionPropNames.ts: -------------------------------------------------------------------------------- 1 | import { NonMatchingPropNames } from './NonMatchingPropNames'; 2 | 3 | /** 4 | * Get all property names holding non-functions. 5 | */ 6 | export type NonFunctionPropNames = NonMatchingPropNames; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/SpreadProps.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Common properties from L and R with undefined in R[K] replaced by type in L[K] 3 | */ 4 | export type SpreadProps = { 5 | [P in K]: L[P] | Exclude; 6 | }; 7 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '@wx-fc/eslint-config/base', 3 | parserOptions: { 4 | ecmaVersion: 2018, 5 | sourceType: 'module', 6 | project: './tsconfig.json', 7 | tsconfigRootDir: __dirname, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /common-configs/tests/test.scss: -------------------------------------------------------------------------------- 1 | @if (1 == 1) { 2 | color: red; 3 | } 4 | 5 | a { 6 | font: { 7 | size: 10px; 8 | weight: 400; 9 | } 10 | } 11 | 12 | $a: 1 !default; 13 | 14 | @if (true) { 15 | $a: 2 !default; 16 | } @else { 17 | $a: 3 !default; 18 | } 19 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/css/reset.css: -------------------------------------------------------------------------------- 1 | font-family: "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif,"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 2 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/NonMatchingProps.ts: -------------------------------------------------------------------------------- 1 | import { NonMatchingPropNames } from './NonMatchingPropNames'; 2 | 3 | /** 4 | * Get all properties with names not matching a type. 5 | */ 6 | export type NonMatchingProps = Pick>; 7 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/shpota/goxygen/cli" 5 | "github.com/shpota/goxygen/codegen" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | args := os.Args[1:] 11 | cli.Start(os.Stdout, args, codegen.Generate) 12 | } 13 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/throttle/constants.ts: -------------------------------------------------------------------------------- 1 | export const CANCEL_KEY = 'redux-middleware-throttle/CANCEL'; 2 | export const FLUSH_KEY = 'redux-middleware-throttle/FLUSH'; 3 | export interface FsaAction { 4 | type: string; 5 | payload: any; 6 | meta: any; 7 | } 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/test/semaphore.ts: -------------------------------------------------------------------------------- 1 | import Semaphore from '../src/Semaphore'; 2 | import { semaphoreSuite } from './semaphoreSuite'; 3 | 4 | suite('Semaphore', () => { 5 | semaphoreSuite((maxConcurrency: number, err?: Error) => new Semaphore(maxConcurrency, err)); 6 | }); 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/TupleTail.ts: -------------------------------------------------------------------------------- 1 | // `...` needs #5453, so syntax errors: 2 | // /** Get a tuple of all but the first element of a tuple-like type. */ 3 | // export type TupleTail> = TupleFrom; 4 | // the<'c', TupleTail<['a', 'b', 'c']>>(); 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/cast/ListToNumObj.ts: -------------------------------------------------------------------------------- 1 | import { Omit } from '../object/Omit'; 2 | import { List } from '../util/List'; 3 | 4 | /** 5 | * Strip a (numerically indexed) type of its `length`. 6 | */ 7 | export type ListToNumObj> = Omit; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/Max.ts: -------------------------------------------------------------------------------- 1 | import { If } from '../util/If'; 2 | 3 | import { Gt } from './Gt'; 4 | 5 | /** 6 | * Get the highest of two number literals. 7 | */ 8 | // @ts-ignore 9 | export type Max = If, A, B>; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/Min.ts: -------------------------------------------------------------------------------- 1 | import { If } from '../util/If'; 2 | 3 | import { Lt } from './Lt'; 4 | 5 | /** 6 | * Get the lowest of two number literals. 7 | */ 8 | // @ts-ignore 9 | export type Min = If, A, B>; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/LiteralProps.ts: -------------------------------------------------------------------------------- 1 | import { LiteralPropNames } from './LiteralPropNames'; 2 | 3 | /** 4 | * Get all properties with names that are literals, i.e. for all but the (string) index. 5 | */ 6 | export type LiteralProps = Pick>; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/Widen.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Widen scalar types from literals to their parent types. 3 | */ 4 | export type Widen = T extends boolean 5 | ? boolean 6 | : T extends number 7 | ? number 8 | : T extends string 9 | ? string 10 | : T; 11 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/example/Simple/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Exception } from '../../src'; 4 | 5 | export interface Props { 6 | className: string; 7 | } 8 | 9 | export default function Simple() { 10 | return ; 11 | } 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/TypesEqual.ts: -------------------------------------------------------------------------------- 1 | import { And } from '../boolean/And'; 2 | 3 | import { Matches } from './Matches'; 4 | 5 | /** 6 | * Check if two types are equal (`==`), i.e. match both ways. 7 | */ 8 | export type TypesEqual = And, Matches>; 9 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/src/index.web.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | export { innerEntityObject } from "./internal/singleton"; 4 | 5 | export { entity, entityProperty } from "./entity/decorator/decorator"; 6 | export { instantiate } from "./entity/factory/factory"; 7 | -------------------------------------------------------------------------------- /common-configs/packages/remark-config/index.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | require('remark-lint'), 3 | require('remark-preset-lint-consistent'), 4 | require('remark-preset-lint-markdown-style-guide'), 5 | require('remark-preset-lint-recommended'), 6 | require('remark-preset-prettier'), 7 | ] 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/IntersectionObjectKeys.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Yields the intersection of the keys of two objects. 3 | */ 4 | // export type IntersectionObjectKeys = Pick, keyof A>[keyof A]; 5 | export type IntersectionObjectKeys = Extract; 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/Omit.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Omit the given keys from an object type. 3 | */ 4 | // export type Omit = Pick>; 5 | export type Omit = T extends any 6 | ? Pick> 7 | : never; 8 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/website/blog/2017-09-26-adding-rss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Adding RSS Support 3 | author: Eric Nakagawa 4 | authorURL: http://twitter.com/ericnakagawa 5 | authorFBID: 661277173 6 | --- 7 | 8 | This is a test post. 9 | 10 | A whole bunch of other information. 11 | -------------------------------------------------------------------------------- /common-configs/codechecks.yml: -------------------------------------------------------------------------------- 1 | checks: 2 | - name: build-size-watcher 3 | options: 4 | files: 5 | - path: 'packages/**/*.*' 6 | - name: type-coverage-watcher 7 | options: 8 | ignoreCatch: true 9 | ignoreFiles: 10 | - '*.d.ts' 11 | strict: true 12 | -------------------------------------------------------------------------------- /common-configs/scripts/upgrade_pkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | cd ./packages 5 | 6 | for file in *; do 7 | [ -d "$file" ] || continue 8 | 9 | if [ "$file" == "config" ]; then 10 | continue 11 | fi 12 | 13 | echo "cd $file" 14 | cd ./$file 15 | ncu -u 16 | cd .. 17 | done 18 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/IntersectionObjects.ts: -------------------------------------------------------------------------------- 1 | import { IntersectionObjectKeys } from './IntersectionObjectKeys'; 2 | 3 | /** 4 | * Filter an object based on the keys present in another object. 5 | */ 6 | export type IntersectionObjects = Pick>; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/ObjectHasStringIndex.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | /** 4 | * Check if an object has a string index. 5 | */ 6 | export type ObjectHasStringIndex = ({ 0: '0' } & { 7 | [k: string]: '1'; 8 | })[Matches]; 9 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/tuple/Unshift.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the given tuple/array with the item type prepended to it 3 | */ 4 | type Unshift = (( 5 | first: Item, 6 | ...rest: List 7 | ) => any) extends (...list: infer R) => any 8 | ? R 9 | : never; 10 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/website/blog/2017-10-24-new-version-1.0.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: New Version 1.0.0 3 | author: Eric Nakagawa 4 | authorURL: http://twitter.com/ericnakagawa 5 | authorFBID: 661277173 6 | --- 7 | 8 | This blog post will test file name parsing issues when periods are present. 9 | -------------------------------------------------------------------------------- /common-configs/scripts/publish_pkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | cd ./packages 5 | 6 | for file in *; do 7 | [ -d "$file" ] || continue 8 | 9 | if [ "$file" == "config" ]; then 10 | continue 11 | fi 12 | 13 | echo "cd $file" 14 | cd ./$file 15 | npm publish 16 | cd .. 17 | done 18 | -------------------------------------------------------------------------------- /common-libs/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { 6 | "language": "typescript", 7 | "autoFix": true 8 | }, 9 | { 10 | "language": "typescriptreact", 11 | "autoFix": true 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/less/mixins/title.less: -------------------------------------------------------------------------------- 1 | #title { 2 | .large() { 3 | font-size: 2rem; 4 | font-weight: bold; 5 | } 6 | 7 | .medium() { 8 | font-size: 1.8rem; 9 | font-weight: bold; 10 | } 11 | 12 | .small() { 13 | font-size: 1.4rem; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/test/util.ts: -------------------------------------------------------------------------------- 1 | import { Clock } from '@sinonjs/fake-timers'; 2 | 3 | export const withTimer = async (clock: Clock, test: () => Promise): Promise => { 4 | const result = test(); 5 | 6 | await clock.runAllAsync(); 7 | 8 | return result; 9 | }; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/tuple/ListTail.ts: -------------------------------------------------------------------------------- 1 | import { ListFrom } from '../array/ListFrom'; 2 | import { List } from '../util/List'; 3 | 4 | /** 5 | * Return the subset of a tuple-like type containing all but the first element. 6 | */ 7 | export type ListTail> = ListFrom; 8 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/src/registry/Registry.ts: -------------------------------------------------------------------------------- 1 | /** 默认的核心注册类 */ 2 | export class Registry { 3 | localMap: Map = new Map(); 4 | 5 | set(key: string, value: object) { 6 | this.localMap.set(key, value); 7 | } 8 | } 9 | 10 | export default new Registry(); 11 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/cast/NumObjToList.ts: -------------------------------------------------------------------------------- 1 | import { Length } from '../array/Length'; 2 | import { NumObj } from '../util/NumObj'; 3 | 4 | /** 5 | * Add an explicit `length` to an object type with number keys. 6 | */ 7 | export type NumObjToList> = O & { length: Length }; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/union/IsUnion.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Check whether a type is a union (of string literals). 3 | */ 4 | export type IsUnion = [T] extends [infer U] 5 | ? U extends any 6 | ? [T] extends [U] 7 | ? N 8 | : Y 9 | : never 10 | : never; 11 | -------------------------------------------------------------------------------- /common-configs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | plugins: [['import', { libraryName: 'antd-mobile', style: true }]], 13 | }; 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/DeconstructUnionHelper.ts: -------------------------------------------------------------------------------- 1 | import { UnionToIntersection } from '../union/UnionToIntersection'; 2 | 3 | export type DeconstructUnionHelper = T & 4 | Partial< 5 | // @ts-ignore 6 | Pick, Exclude, keyof T>> 7 | >; 8 | -------------------------------------------------------------------------------- /common-configs/packages/postcss-config/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'], 3 | darkMode: false, // or 'media' or 'class' 4 | theme: { 5 | extend: {}, 6 | }, 7 | variants: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | }; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/union/UnionToIntersection.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * src: https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type 3 | */ 4 | export type UnionToIntersection = ( 5 | U extends any ? (k: U) => void : never 6 | ) extends (k: infer I) => void 7 | ? I 8 | : never; 9 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/docker-compose-dev.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | dev_db: 4 | image: mongo:4.2.3 5 | environment: 6 | MONGO_INITDB_DATABASE: tech 7 | ports: 8 | - 27017:27017 9 | volumes: 10 | - ./init-db.js:/docker-entrypoint-initdb.d/init.js 11 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { 6 | "language": "typescript", 7 | "autoFix": true 8 | }, 9 | { 10 | "language": "typescriptreact", 11 | "autoFix": true 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/vue.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('./base') 2 | 3 | module.exports = Object.assign({}, baseConfig, { 4 | overrides: baseConfig.overrides.concat([ 5 | { 6 | files: '*.html', 7 | options: { 8 | parser: 'vue', 9 | }, 10 | }, 11 | ]), 12 | }) 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/Or.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from '../util/Bool'; 2 | import { Obj } from '../util/Obj'; 3 | 4 | /** 5 | * Logical `OR`, `||` equivalent for string bools. 6 | */ 7 | export type Or = ({ 8 | 0: { 0: '0' } & Obj<'1'>; 9 | } & Obj>)[A][B]; 10 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "env", 4 | "stage-3", 5 | "flow", 6 | "jest" 7 | ], 8 | "plugins": [ 9 | "lodash", 10 | "transform-runtime", 11 | "transform-decorators-legacy", 12 | "transform-class-properties" 13 | ] 14 | } -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/demo/app.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | const Koa = require('koa'); 4 | 5 | import router from './router'; 6 | 7 | const app = new Koa(); 8 | 9 | // 设置路由配置信息 10 | app.use(router.routes()).use(router.allowedMethods()); 11 | 12 | // 启动 Web 服务器 13 | app.listen(3001); 14 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/next.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('./base') 2 | 3 | module.exports = Object.assign({}, baseConfig, { 4 | overrides: baseConfig.overrides.concat([ 5 | { 6 | files: '*.ts', 7 | options: { 8 | parser: 'babel-ts', 9 | }, 10 | }, 11 | ]), 12 | }) 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-plugible/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { 6 | "language": "typescript", 7 | "autoFix": true 8 | }, 9 | { 10 | "language": "typescriptreact", 11 | "autoFix": true 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/And.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from '../util/Bool'; 2 | import { Obj } from '../util/Obj'; 3 | 4 | /** 5 | * Logical `AND`, `&&` equivalent for string bools. 6 | */ 7 | export type And = ({ 8 | 1: { 1: '1' } & Obj<'0'>; 9 | } & Obj>)[A][B]; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/PrototypeHas.ts: -------------------------------------------------------------------------------- 1 | import { ObjectHasKey } from './ObjectHasKey'; 2 | import { Prototype } from './Prototype'; 3 | 4 | /** 5 | * Check if a key is among those used to access prototype methods on object types. 6 | */ 7 | export type PrototypeHas = ObjectHasKey; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/types/basic/Primitive.ts: -------------------------------------------------------------------------------- 1 | /** 2 | Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). 3 | @category Basic 4 | */ 5 | export type Primitive = 6 | | null 7 | | undefined 8 | | string 9 | | number 10 | | boolean 11 | | symbol 12 | | bigint; 13 | -------------------------------------------------------------------------------- /common-libs/scripts/tools/upgrade_pkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | cd ./packages 5 | 6 | for file in *; do 7 | [ -d "$file" ] || continue 8 | 9 | if [ "$file" == "config" ]; then 10 | continue 11 | fi 12 | 13 | echo "cd $file"; 14 | cd ./$file 15 | ncu -u 16 | cd .. 17 | done 18 | -------------------------------------------------------------------------------- /common-configs/packages/prettier-config/angular.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('./base') 2 | 3 | module.exports = Object.assign({}, baseConfig, { 4 | overrides: baseConfig.overrides.concat([ 5 | { 6 | files: '*.html', 7 | options: { 8 | parser: 'angular', 9 | }, 10 | }, 11 | ]), 12 | }) 13 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/src/pack-fsa/constants.ts: -------------------------------------------------------------------------------- 1 | export const KEY = { 2 | LIFECYCLE: 'redux-middleware-pack-fsa/LIFECYCLE', 3 | TRANSACTION: 'redux-middleware-pack-fsa/TRANSACTION', 4 | }; 5 | 6 | export const LIFECYCLE = { 7 | START: 'start', 8 | SUCCESS: 'success', 9 | FAILURE: 'failure', 10 | }; 11 | -------------------------------------------------------------------------------- /common-libs/scripts/tools/lint_pkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | cd ./packages 5 | 6 | for file in *; do 7 | [ -d "$file" ] || continue 8 | 9 | if [ "$file" == "config" ]; then 10 | continue 11 | fi 12 | 13 | echo "cd $file"; 14 | cd ./$file 15 | yarn run lint 16 | cd .. 17 | done 18 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { 6 | "language": "typescript", 7 | "autoFix": true 8 | }, 9 | { 10 | "language": "typescriptreact", 11 | "autoFix": true 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /common-configs/packages/stylelint-config/modules.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'], 3 | rules: { 4 | 'selector-pseudo-class-no-unknown': [ 5 | true, 6 | { 7 | ignorePseudoClasses: ['export', 'local', 'global'], 8 | }, 9 | ], 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | plugins: [['import', { libraryName: 'antd-mobile', style: true }]], 13 | }; 14 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | plugins: [['import', { libraryName: 'antd-mobile', style: true }]], 13 | }; 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/StringsEqual.ts: -------------------------------------------------------------------------------- 1 | import { UnionHasKey } from '../union/UnionHasKey'; 2 | 3 | /** 4 | * Check whether two string literal types are equivalent. 5 | * @deprecated ditch for Matches 6 | */ 7 | export type StringsEqual = UnionHasKey< 8 | A, 9 | B 10 | >; 11 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/If.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from './Bool'; 2 | 3 | /** 4 | * Type-level equivalent of ternary operator `a ? b : c`. 5 | * Seems good for recursion, but a type can't reference itself in the top layer. 6 | */ 7 | // @ts-ignore 8 | export type If = { 1: Then; 0: Else }[Cond]; 9 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@wx-fc', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | plugins: [['import', { libraryName: 'antd-mobile', style: true }]], 13 | }; 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/DefinitelyYes.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from '../util/Bool'; 2 | 3 | import { And } from './And'; 4 | import { Determinate } from './Determinate'; 5 | 6 | /** 7 | * Checks whether a string bool has `'1'`, yet not `'0'`. 8 | */ 9 | export type DefinitelyYes = And>; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/Gt.ts: -------------------------------------------------------------------------------- 1 | import { Dec } from '../number/Dec'; 2 | import { Matches } from '../type/Matches'; 3 | 4 | /** 5 | * Type-level `>`. 6 | */ 7 | // @ts-ignore 8 | export type Gt = { 9 | 1: '0'; 10 | 0: B extends 0 ? '1' : Gt; 11 | }[Matches]; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/Lt.ts: -------------------------------------------------------------------------------- 1 | import { Dec } from '../number/Dec'; 2 | import { Matches } from '../type/Matches'; 3 | 4 | /** 5 | * Type-level `<`. 6 | */ 7 | // @ts-ignore 8 | export type Lt = { 9 | 1: '0'; 10 | 0: A extends 0 ? '1' : Lt; 11 | }[Matches]; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/number/Subtract.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | import { Dec } from './Dec'; 4 | 5 | /** 6 | * Subtract two numbers. 7 | */ 8 | // @ts-ignore 9 | export type Subtract = { 10 | 1: A; 11 | 0: Subtract; 12 | }[Matches]; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | 11 | declare module '*.svg' { 12 | const content: string; 13 | export default content; 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | 11 | declare module '*.svg' { 12 | const content: string; 13 | export default content; 14 | } 15 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | code { 2 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 3 | monospace; 4 | background-color: #b3e6ff; 5 | } 6 | 7 | .title { 8 | text-align: center; 9 | } 10 | 11 | .logo { 12 | text-align: center; 13 | } 14 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'project-name'; 10 | } 11 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@m-fe/tsconfig/tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "target": "ESNext", 6 | "paths": { 7 | "@/*": ["src/*"] 8 | } 9 | }, 10 | "include": ["src/**/*"], 11 | "exclude": ["**/*.spec.ts", "**/*.test.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | 11 | declare module '*.svg' { 12 | const content: string; 13 | export default content; 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/Gte.ts: -------------------------------------------------------------------------------- 1 | import { Dec } from '../number/Dec'; 2 | import { Matches } from '../type/Matches'; 3 | 4 | /** 5 | * Type-level `>=`. 6 | */ 7 | // @ts-ignore 8 | export type Gte = { 9 | 1: '1'; 10 | 0: A extends 0 ? '0' : Gte; 11 | }[Matches]; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/Lte.ts: -------------------------------------------------------------------------------- 1 | import { Dec } from '../number/Dec'; 2 | import { Matches } from '../type/Matches'; 3 | 4 | /** 5 | * Type-level `<=`. 6 | */ 7 | // @ts-ignore 8 | export type Lte = { 9 | 1: '1'; 10 | 0: B extends 0 ? '0' : Lte; 11 | }[Matches]; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/function/IsValidArg.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Check if an inferred parameter on a function type exists. 3 | * @see https://github.com/Microsoft/TypeScript/pull/21316#issuecomment-374191157 4 | */ 5 | export type IsValidArg = T extends object 6 | ? keyof T extends never 7 | ? false 8 | : true 9 | : true; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/ObjectHasElem.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | import { ObjectValsToUnion } from './ObjectValsToUnion'; 4 | 5 | /** 6 | * Check whether a heterogeneous object type contains a given type among its elements. 7 | */ 8 | export type ObjectHasElem = Matches>; 9 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /common-configs/packages/jest-config/jest-puppeteer.config.js: -------------------------------------------------------------------------------- 1 | // ps https://github.com/GoogleChrome/puppeteer/issues/3120 2 | module.exports = { 3 | launch: { 4 | args: [ 5 | '--disable-gpu', 6 | '--disable-dev-shm-usage', 7 | '--no-first-run', 8 | '--no-zygote', 9 | '--no-sandbox', 10 | ], 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | 11 | declare module '*.svg' { 12 | const content: string; 13 | export default content; 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | 11 | declare module '*.svg' { 12 | const content: string; 13 | export default content; 14 | } 15 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "declaration": false, 6 | "declarationMap": false, 7 | "paths": { 8 | "@/*": [ 9 | "./src/*" 10 | ] 11 | }, 12 | "outDir": "dist" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/Indeterminate.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | import { And } from './And'; 4 | 5 | /** 6 | * Checks whether a string bool has an interminate result, that is, `'1' | '0'`. 7 | */ 8 | export type Indeterminate = And< 9 | Matches<'0', T>, 10 | Matches<'1', T> 11 | >; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/number/Add.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | import { Dec } from './Dec'; 4 | import { Inc } from './Inc'; 5 | 6 | /** 7 | * Add two numbers. 8 | */ 9 | // @ts-ignore 10 | export type Add = { 11 | 1: A; 12 | 0: Add; 13 | }[Matches]; 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/Awaited.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Unwrap a `Promise` to obtain its return value. 3 | * @see https://github.com/Microsoft/TypeScript/pull/21613 4 | */ 5 | export type Awaited = { 6 | '1': T extends { then(onfulfilled: (value: infer U) => any): any } 7 | ? Awaited 8 | : T; 9 | }[T extends number ? '1' : '1']; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/union/UnionHasKey.ts: -------------------------------------------------------------------------------- 1 | import { Obj } from '../util/Obj'; 2 | 3 | /** 4 | * Check if a union contains a given string literal. 5 | * Deprecated, ditch for `Matches`. 6 | * @deprecated 7 | */ 8 | export type UnionHasKey = ({ 9 | [S in Union]: '1'; 10 | } & 11 | Obj<'0'>)[K]; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/func/index.ts: -------------------------------------------------------------------------------- 1 | export * from './debounce'; 2 | export * from './error'; 3 | export * from './event-loop'; 4 | export * from './EventEmitter'; 5 | export * from './get'; 6 | export * from './idle-task'; 7 | export * from './log'; 8 | export * from './promise'; 9 | export * from './throttle'; 10 | export * from './utils'; 11 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | 6 | declare module '*.css' { 7 | const content: any; 8 | export default content; 9 | } 10 | 11 | declare module '*.svg' { 12 | const content: string; 13 | export default content; 14 | } 15 | -------------------------------------------------------------------------------- /common-configs/packages/stylelint-config/tests/test.less: -------------------------------------------------------------------------------- 1 | .link { 2 | padding: 4px 16px; 3 | transition-duration: 0.2s; 4 | transition-property: background-color, color; 5 | 6 | &:hover { 7 | background-color: @backgroundColorSecondary; 8 | } 9 | 10 | &.active { 11 | color: @white; 12 | background-color: @textColor; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './auth'; 2 | export * from './containers'; 3 | export * from './ellipsis'; 4 | export * from './Exception'; 5 | export * from './HeaderDropdown'; 6 | export * from './LangSelector'; 7 | export * from './NoticeIcon'; 8 | export * from './PageHeader'; 9 | export * from './PageLoading'; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/IntersectValueOf.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Intersection of all value types. 3 | * @see https://github.com/Microsoft/TypeScript/pull/21496#issuecomment-363159497 4 | */ 5 | export type IntersectValueOf = { 6 | [K in keyof T]: (x: T[K]) => void; 7 | } extends Record void> 8 | ? V 9 | : never; 10 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/dist/main.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | ReactDOM.render(React.createElement(React.StrictMode, null, 6 | React.createElement(App, null)), document.getElementById('root')); 7 | console.log(import.meta.env.DEV); 8 | //# sourceMappingURL=main.js.map -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/DifferenceTuples.ts: -------------------------------------------------------------------------------- 1 | // `...` needs #5453, so syntax errors: 2 | // /** Get the subset of a tuple starting from the end of another tuple. */ 3 | // export type DifferenceTuples, Small extends List> = TupleFrom>; 4 | // the<['c', 'd'], DifferenceTuples<['a', 'b', 'c', 'd'], [123, 456]>>(); 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/union/UnionEmpty.ts: -------------------------------------------------------------------------------- 1 | import { And } from '../boolean/And'; 2 | 3 | import { UnionContained } from './UnionContained'; 4 | 5 | /** 6 | * Check if a union is empty, that is, if a type is `never`. 7 | */ 8 | export type UnionEmpty = And< 9 | UnionContained, 10 | UnionContained 11 | >; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/ds/index.ts: -------------------------------------------------------------------------------- 1 | export * from './array'; 2 | export * from './datetime'; 3 | export * from './equal'; 4 | export * from './error'; 5 | export * from './ip'; 6 | export * from './kv'; 7 | export * from './number'; 8 | export * from './object'; 9 | export * from './str'; 10 | export * from './uri'; 11 | export * from './validator'; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/func/log.ts: -------------------------------------------------------------------------------- 1 | export function log(...args: any[]) { 2 | console.log(args); 3 | } 4 | 5 | export function warn(...args: any[]) { 6 | console.log(args); 7 | } 8 | 9 | export function info(...args: any[]) { 10 | console.log(args); 11 | } 12 | 13 | export function error(...args: any[]) { 14 | console.error(args); 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @m-fe/commons docs 6 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "rootDir": "./src", 6 | "outDir": "dist/cjs", 7 | "declaration": true, 8 | "declarationDir": "dist/types", 9 | "sourceMap": false, 10 | "paths": {} 11 | }, 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/.storybook/config.js: -------------------------------------------------------------------------------- 1 | import { configure } from '@storybook/react'; 2 | 3 | // automatically import all files ending in *.stories.js 4 | const req = require.context('../stories', true, /\.stories\.tsx?$/); 5 | function loadStories() { 6 | req.keys().forEach(filename => req(filename)); 7 | } 8 | 9 | configure(loadStories, module); 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/number/Dec.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * An object allowing one to decrease a number by one. 3 | */ 4 | export type Dec = { 5 | [i: number]: number; 6 | 0: -1; 7 | 1: 0; 8 | 2: 1; 9 | 3: 2; 10 | 4: 3; 11 | 5: 4; 12 | 6: 5; 13 | 7: 6; 14 | 8: 7; 15 | 9: 8; 16 | }; 17 | // R.pipe(R.range(0), R.map(R.dec), JSON.stringify)(256) 18 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/InstanceOf.ts: -------------------------------------------------------------------------------- 1 | import { And } from '../boolean/And'; 2 | import { Not } from '../boolean/Not'; 3 | 4 | import { Matches } from './Matches'; 5 | 6 | /** 7 | * Check if a type is an instance of another, that is, matches it but is not equal (`<`). 8 | */ 9 | export type InstanceOf = And, Not>>; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/union/UnionsOverlap.ts: -------------------------------------------------------------------------------- 1 | import { Not } from '../boolean/Not'; 2 | import { UnionEmpty } from '../union/UnionEmpty'; 3 | 4 | /** 5 | * Check if there is any overlap between two unions of string literals. 6 | */ 7 | export type UnionsOverlap = Not< 8 | UnionEmpty> 9 | >; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "rootDir": "./src", 6 | "outDir": "dist/cjs", 7 | "declaration": true, 8 | "declarationDir": "dist/types", 9 | "sourceMap": false, 10 | "paths": {} 11 | }, 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "rootDir": "./src", 6 | "outDir": "dist/cjs", 7 | "declaration": true, 8 | "declarationDir": "dist/types", 9 | "sourceMap": false, 10 | "paths": {} 11 | }, 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root'), 11 | ); 12 | 13 | console.log((import.meta as any).env.DEV); 14 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "rootDir": "./src", 6 | "outDir": "dist/cjs", 7 | "declaration": true, 8 | "declarationDir": "dist/types", 9 | "sourceMap": false, 10 | "paths": {} 11 | }, 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "rootDir": "./src", 6 | "outDir": "dist/cjs", 7 | "declaration": true, 8 | "declarationDir": "dist/types", 9 | "sourceMap": false, 10 | "paths": {} 11 | }, 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/DefinitelyNo.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from '../util/Bool'; 2 | 3 | import { And } from './And'; 4 | import { Determinate } from './Determinate'; 5 | import { Not } from './Not'; 6 | 7 | /** 8 | * Checks whether a string bool has `'0'`, yet not `'1'`. 9 | */ 10 | export type DefinitelyNo = And, Determinate>; 11 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root .title')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/less/mixins/textarea.less: -------------------------------------------------------------------------------- 1 | #textarea { 2 | .default() { 3 | border-radius: 4px; 4 | padding: 0.3rem 0.5rem; 5 | font-size: 1rem; 6 | font-family: @primary-font; 7 | #display.dimensions(97%, 200px); 8 | #border.solid(1px, @color-01); 9 | 10 | &:focus { 11 | border-color: @color-01; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/function/Bind.ts: -------------------------------------------------------------------------------- 1 | // /** Bind a type to a function's `this` object. */ 2 | // export type Bind R, This, Args, R, T extends This> = Fn; 3 | // // ^ doesn't handle other params yet. `unbind` notes above apply as well. only useful after #6606. 4 | // // ^ accurate return type over `R`: `F(this: T, ...Args)`. 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/KeyedSafe.ts: -------------------------------------------------------------------------------- 1 | import { Obj } from '../util/Obj'; 2 | 3 | import { Keyed } from './Keyed'; 4 | 5 | /** 6 | * Use an object type to make an object type using its keys as both keys and values. 7 | * Additionally has a string index of `never` to allow safe property access. 8 | */ 9 | export type KeyedSafe = Keyed & Obj; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/tuple/Prepend.ts: -------------------------------------------------------------------------------- 1 | import { List } from '../util/List'; 2 | 3 | import { IncIndex } from './IncIndex'; 4 | /** 5 | * Prepend an element to a tuple-like type, returning a numerical object. 6 | * Presumes the list is already zero-indexed, otherwise needs `ZeroIndex`. 7 | */ 8 | export type Prepend, T> = { 0: T } & IncIndex; 9 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/Xor.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get the disjoint union of two types, yielding `never` for types satisfying neither/both. 3 | * @see https://github.com/Microsoft/TypeScript/pull/21316#issuecomment-360862303 4 | */ 5 | export type Xor = T extends A 6 | ? T extends B 7 | ? never 8 | : T 9 | : T extends B 10 | ? T 11 | : never; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/func/__test__/EventEmitter.test.ts: -------------------------------------------------------------------------------- 1 | import { EventEmitter } from '../EventEmitter'; 2 | 3 | describe('', () => { 4 | it('', done => { 5 | class A extends EventEmitter<'A'> {} 6 | 7 | const a = new A(); 8 | 9 | a.on('A', () => { 10 | console.log(1); 11 | done(); 12 | }); 13 | a.emit('A'); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/node_modules/.* 3 | .*/dist/.* 4 | .*/test/.* 5 | .*/demo/.* 6 | .*/**/package.json 7 | 8 | [include] 9 | 10 | 11 | [libs] 12 | ./flow-typed 13 | 14 | [options] 15 | module.file_ext=.css 16 | module.file_ext=.js 17 | module.file_ext=.jsx 18 | module.file_ext=.json 19 | 20 | [lints] 21 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/TupleProp.ts: -------------------------------------------------------------------------------- 1 | import { List } from '../util/List'; 2 | 3 | /** 4 | * Get the element of a tuple-like type at the given index. Not useful, just use `tpl[i]`. 5 | * @param Arr tuple-like type 6 | * @param I the index to check 7 | * @returns element type 8 | */ 9 | export type TupleProp, I extends number> = Arr[I]; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/Dictionary.ts: -------------------------------------------------------------------------------- 1 | // type Dictionary = Partial>; 2 | // type Dictionary = { [P in K]?: T }; 3 | 4 | // If you need to support numbers and symbols as keys: 5 | // type Dictionary = Partial>; 6 | export type Dictionary = { [P in K]?: T }; 7 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/ObjectHasKeySafe.ts: -------------------------------------------------------------------------------- 1 | import { UnionsOverlap } from '../union/UnionsOverlap'; 2 | 3 | /** 4 | * Check if an object type has a certain key. 5 | * Will not look for prototype methods for keys like `toString`. 6 | */ 7 | export type ObjectHasKeySafe = 8 | // @ts-ignore 9 | UnionsOverlap; 10 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "rootDir": "./src", 6 | "outDir": "dist/cjs", 7 | "declaration": true, 8 | "declarationDir": "dist/types", 9 | "sourceMap": false, 10 | "paths": {} 11 | }, 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@m-fe/tsconfig/tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["packages/rtw-host-app/src/*"] 7 | }, 8 | "strictFunctionTypes": false, 9 | "strictNullChecks": false, 10 | "allowSyntheticDefaultImports": true 11 | }, 12 | "include": ["**/*.ts", "**/*.tsx"] 13 | } 14 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/react.webapp/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {render} from '@testing-library/react'; 3 | import {App} from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const {getByText} = render(); 7 | const linkElement = getByText(/goxygen/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const path = require('path'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | module.exports = merge(umdConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.ts'), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const path = require('path'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | module.exports = merge(umdConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.ts'), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/boolean/Determinate.ts: -------------------------------------------------------------------------------- 1 | import { Bool } from '../util/Bool'; 2 | 3 | import { Indeterminate } from './Indeterminate'; 4 | import { Not } from './Not'; 5 | 6 | /** 7 | * Checks whether a string bool has an terminate result, that is, either `'1'` or `'0'`, but not their union. 8 | */ 9 | export type Determinate = Not>; 10 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const path = require('path'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | module.exports = merge(umdConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.ts'), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "resolveJsonModule": true, 5 | "downlevelIteration": true, 6 | "esModuleInterop": true, 7 | "allowSyntheticDefaultImports": true, 8 | "noImplicitAny": false, 9 | "module": "ESNext" 10 | }, 11 | "include": ["src/**/*", "example/**/*"] 12 | } 13 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite Test App 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const path = require('path'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | module.exports = merge(umdConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.ts'), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const path = require('path'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | module.exports = merge(umdConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.ts'), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/IsTuple.ts: -------------------------------------------------------------------------------- 1 | import { And } from '../boolean/And'; 2 | import { InstanceOf } from '../type/InstanceOf'; 3 | 4 | import { IsArrayType } from './IsArrayType'; 5 | 6 | /** 7 | * Check whether a type is a tuple type 8 | */ 9 | export type IsTuple = And< 10 | IsArrayType, 11 | InstanceOf 12 | >; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './util'; 2 | export * from './boolean'; 3 | export * from './type'; 4 | export * from './cast'; 5 | export * from './number'; 6 | export * from './comp'; 7 | export * from './union'; 8 | export * from './object'; 9 | export * from './array'; 10 | export * from './tuple'; 11 | export * from './function'; 12 | export * from './ramda'; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/number/Modulo.ts: -------------------------------------------------------------------------------- 1 | import { Gt } from '../comp/Gt'; 2 | 3 | import { Inc } from './Inc'; 4 | import { Subtract } from './Subtract'; 5 | /** 6 | * Take the modulo of two numbers. 7 | */ 8 | export type Modulo = 9 | // @ts-ignore 10 | { 0: A; 1: Modulo, B, Inc[Acc]> }[Gt]; 11 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/PrototypeMethods.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Union of keys used to access prototype methods on object types. 3 | */ 4 | export type PrototypeMethods = 'toLocaleString' | 'toString'; // | 'constructor' | 'hasOwnProperty' | 'isPrototypeOf' | 'propertyIsEnumerable' | 'valueOf' | '__defineGetter__' | '__defineSetter__' | '__lookupGetter__' | '__lookupSetter__' | '__proto__'; 5 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/Swap.ts: -------------------------------------------------------------------------------- 1 | import { Obj } from '../util/Obj'; 2 | 3 | /** 4 | * Swap the keys and values of an object type with string literals as values. 5 | */ 6 | export type Swap< 7 | T extends Obj, 8 | Keys extends keyof T = keyof T, 9 | Vals extends string = T[Keys] 10 | > = { [P1 in Vals]: { [P2 in Keys]: P1 extends T[P2] ? P2 : never }[Keys] }; 11 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example-node/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const merge = require('webpack-merge'); 4 | 5 | module.exports = merge( 6 | require('../webpack.config.node')({ 7 | rootPath: path.resolve(__dirname, './'), 8 | }), 9 | { 10 | entry: { 11 | index: path.resolve(__dirname, './index.ts'), 12 | }, 13 | }, 14 | ); 15 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example-node/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const merge = require('webpack-merge'); 4 | 5 | module.exports = merge( 6 | require('../webpack.config.node')({ 7 | rootPath: path.resolve(__dirname, './'), 8 | }), 9 | { 10 | entry: { 11 | index: path.resolve(__dirname, './index.ts'), 12 | }, 13 | }, 14 | ); 15 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/src/vanilla/__test__/proxy.test.ts: -------------------------------------------------------------------------------- 1 | import { proxy, subscribe } from '../proxy'; 2 | 3 | describe('proxy', () => { 4 | it('proxy listerner cb', done => { 5 | const proxiedObj = proxy({ a: 1 }); 6 | 7 | subscribe(proxiedObj, () => { 8 | console.log(proxiedObj); 9 | done(); 10 | }); 11 | 12 | proxiedObj.a = 2; 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-async/src/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Mutex } from './Mutex'; 2 | export { default as MutexInterface } from './MutexInterface'; 3 | export { default as Semaphore } from './Semaphore'; 4 | export { default as SemaphoreInterface } from './SemaphoreInterface'; 5 | export { withTimeout } from './withTimeout'; 6 | export { tryAcquire } from './tryAcquire'; 7 | export * from './errors'; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/ObjectHasKey.ts: -------------------------------------------------------------------------------- 1 | import { UnionHasKey } from '../union/UnionHasKey'; 2 | 3 | /** 4 | * Check if an object type has a certain key. 5 | * Returns prototype methods for keys like `toString`. 6 | */ 7 | export type ObjectHasKey = UnionHasKey< 8 | // @ts-ignore 9 | keyof O, 10 | K 11 | >; 12 | // > = Matches; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/ObjectNumberKeys.ts: -------------------------------------------------------------------------------- 1 | import { NumberToNumber } from '../cast/NumberToNumber'; 2 | 3 | /** 4 | * A `number` variant of `keyof`, giving a union of a tuple/object with number-like keys. 5 | * Technically returns string literals e.g. `"3"` rather than `3` -- works for element access. 6 | */ 7 | export type ObjectNumberKeys = Extract; 8 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/func/__test__/throttle.test.ts: -------------------------------------------------------------------------------- 1 | import { throttleAndQueue } from '../throttle'; 2 | 3 | it('throttleAndQueue', () => { 4 | const logMessageLimited = throttleAndQueue((msg: string) => { 5 | console.log(msg); 6 | }, 10 * 1000); 7 | 8 | for (let i = 0; i < 3; i++) { 9 | logMessageLimited(`[Message Log] Action (${i}) rate limited.`); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/ramda/Pipe.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Performs left-to-right function composition. 3 | * @see http://ramdajs.com/docs/#pipe 4 | */ 5 | // type Pipe any>, F = Fs[0], Args = Arguments> = Fn, F(...Args)>>; 6 | // // ^ todo: use generics so as to plug in not the static `Args` but base return value on the actual input types 7 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const path = require('path'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | module.exports = merge(umdConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.ts'), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@wx-fc/tsconfig/tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["packages/mfs-host-app/src/*"] 7 | }, 8 | "strictFunctionTypes": false, 9 | "strictNullChecks": false, 10 | "suppressImplicitAnyIndexErrors": true 11 | }, 12 | "include": ["**/*.ts", "**/*.tsx"] 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/components/PageLoading/index.tsx: -------------------------------------------------------------------------------- 1 | import { Spin } from 'antd'; 2 | import * as React from 'react'; 3 | 4 | // loading components from code split 5 | // https://umijs.org/plugin/umi-plugin-react.html#dynamicimport 6 | export const PageLoading: React.FC = () => ( 7 |
8 | 9 |
10 | ); 11 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/TupleHasIndex.ts: -------------------------------------------------------------------------------- 1 | import { List } from '../util/List'; 2 | 3 | /** 4 | * Checks whether a tuple-like type has a (numerical) index 5 | * @param Arr tuple-like type 6 | * @param I the index to check 7 | * @returns a string bool 8 | */ 9 | export type TupleHasIndex, I extends number> = ({ 10 | [K in keyof Arr]: '1'; 11 | } & 12 | '0'[])[I]; 13 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/demo/entity/auth/UserProperty.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import { entityProperty } from "../../../src/entity/decorator/decorator"; 3 | 4 | export default class UserProperty { 5 | // 朋友列表 6 | @entityProperty({ 7 | type: ["integer"], 8 | description: "user friends, which is user ids", 9 | required: false 10 | }) 11 | friends: [number]; 12 | } 13 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/scripts/docker/Dockerfile.gitlab: -------------------------------------------------------------------------------- 1 | FROM mhart/alpine-node:latest as builder 2 | 3 | # 安装与编译代码 4 | COPY . /app 5 | WORKDIR /app 6 | 7 | RUN yarn install --frozen-lockfile --registry https://registry.npm.taobao.org/ 8 | RUN yarn build 9 | RUN find . -name '*.map' -type f -exec rm -f {} \; 10 | 11 | # 最终的应用 12 | FROM abiosoft/caddy 13 | COPY --from=builder /app/build /srv 14 | EXPOSE 2015 15 | -------------------------------------------------------------------------------- /common-configs/packages/stylelint-config/scss/loose.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('.'); 2 | 3 | module.exports = Object.assign({}, baseConfig, { 4 | rules: Object.assign({}, baseConfig.rules, { 5 | 'scss/declaration-nested-properties': null, 6 | 'scss/dollar-variable-default': null, 7 | 'scss/media-feature-value-dollar-variable': null, 8 | 'scss/selector-nest-combinators': null, 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["src/*"], 3 | "compilerOptions": { 4 | "strict": true, 5 | "forceConsistentCasingInFileNames": true, 6 | "target": "ESNext", 7 | "module": "CommonJS", 8 | "moduleResolution": "Node", 9 | "outDir": "dist", 10 | "declaration": true, 11 | "skipLibCheck": true, 12 | "noUncheckedIndexedAccess": true 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/less/mixins/image.less: -------------------------------------------------------------------------------- 1 | // General, useful image styles 2 | #image { 3 | .border(@size: 1px, @border-color: @color-01) when (default()) { 4 | border: @size solid @border-color; 5 | } 6 | 7 | .border(@type, @size: 1px, @border-color: @color-01, @radius: 0) when (@type = rounded) { 8 | border: @size solid @border-color; 9 | border-radius: @radius; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/Unknown.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The type of all values; nothing is known about it a priori 3 | * except that it exists. The same idea as Flow's `mixed` type. 4 | * Borrowed from @pelotom's `type-zoo` 5 | * 6 | * @see https://github.com/pelotom/type-zoo/#unknown 7 | * @see https://github.com/Microsoft/TypeScript/issues/10715 8 | */ 9 | export type Unknown = {} | undefined | null; 10 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/src/particle/fireworks/global.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-require-imports */ 2 | // This file will add both p5 instanced and global intellisence 3 | import module = require('p5'); 4 | import * as p5Global from 'p5/global'; 5 | 6 | export = module; 7 | export as namespace p5; 8 | declare global { 9 | interface Window { 10 | p5: typeof module; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/type/DiscriminateUnion.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get the constituent of a tagged union given the value of the discriminant. 3 | * @see https://github.com/Microsoft/TypeScript/pull/21316#issuecomment-364982638 4 | */ 5 | export type DiscriminateUnion< 6 | Union, 7 | TagKey extends keyof Union, 8 | TagValue extends Union[TagKey] 9 | > = Union extends Record ? Union : never; 10 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/flow-typed/modules.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | declare module 'debug' { 4 | declare module.exports: any; 5 | } 6 | 7 | declare module 'declarative-validaror' { 8 | declare module.exports: any; 9 | } 10 | 11 | declare module 'sequelize' { 12 | declare module.exports: any; 13 | } 14 | 15 | declare module 'babel-core' { 16 | declare module.exports: any; 17 | } 18 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | project-name 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.ts" 13 | ], 14 | "exclude": [ 15 | "src/test.ts", 16 | "src/**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/src/__test__/AddressParser.test.ts: -------------------------------------------------------------------------------- 1 | import { AddressParser } from '../AddressParser'; 2 | 3 | describe('地址解析测试', () => { 4 | it('AddressParser', () => { 5 | const p = new AddressParser( 6 | // '张三1351111111江苏省扬州市广陵区XX小区X楼xxx室', 7 | '上海普陀区中山北路2000号23楼 李米收 18930739541', 8 | ); 9 | 10 | const results = p.parse(); 11 | 12 | console.log(results); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/env/i18n.ts: -------------------------------------------------------------------------------- 1 | export type I18nFormat = ( 2 | id: string, 3 | values?: Record, 4 | defaultMessage?: string, 5 | ) => string; 6 | 7 | let i18nFormat: I18nFormat; 8 | 9 | export function setI18nFormat(_i: I18nFormat) { 10 | i18nFormat = _i; 11 | } 12 | 13 | export function getI18nFormat() { 14 | const a = (a: string) => `${a}`; 15 | 16 | return i18nFormat || a; 17 | } 18 | -------------------------------------------------------------------------------- /common-configs/tests/test.less: -------------------------------------------------------------------------------- 1 | @width: 10px; 2 | @height: @width + 10px; 3 | 4 | #header { 5 | width: @width; 6 | height: @height; 7 | } 8 | 9 | .component { 10 | width: 300px; 11 | @media (min-width: 768px) { 12 | width: 600px; 13 | @media (min-resolution: 192dpi) { 14 | background-image: url(/img/retina2x.png); 15 | } 16 | } 17 | @media (min-width: 1280px) { 18 | width: 800px; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common-libs/packages/animation-effect/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/state-management/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/TupleFrom.ts: -------------------------------------------------------------------------------- 1 | // `...` needs #5453, so syntax errors: 2 | // /** From a tuple-like type, get the subset starting from a certain index. Returns a tuple type. */ 3 | // export type TupleFrom, I extends number, Acc extends List = []> = 4 | // { 0: Acc, 1: TupleFrom }[TupleHasIndex]; 5 | // the<['c', 'd'], TupleFrom<['a', 'b', 'c', 'd'], 2>>(); 6 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/number/Mult.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | import { Add } from './Add'; 4 | import { Dec } from './Dec'; 5 | 6 | /** 7 | * Multiply two numbers. 8 | */ 9 | export type Mult
= 10 | // @ts-ignore 11 | { 12 | 1: Acc; 13 | // @ts-ignore 14 | 0: Mult>; 15 | }[Matches]; 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/union/UnionContained.ts: -------------------------------------------------------------------------------- 1 | import { DefinitelyYes } from '../boolean/DefinitelyYes'; 2 | import { Obj } from '../util/Obj'; 3 | 4 | /** 5 | * Check if a union is wholly contained in another one. 6 | * Deprecated, ditch for `Matches`. 7 | * @deprecated 8 | */ 9 | export type UnionContained = DefinitelyYes< 10 | ({ [P in U]: '1' } & Obj<'0'>)[T | U] 11 | >; 12 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/test/swagger/swagger.test.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | const chaiExpect = require("chai").expect; 3 | import { _convertParameterInPath } from "../../src/swagger/paths"; 4 | 5 | describe("内部辅助函数", () => { 6 | it("将 Express 风格路径参数转化为 Swagger 风格", () => { 7 | chaiExpect(_convertParameterInPath("/user/:id?name=1")).to.equal( 8 | "/user/{id}?name=1" 9 | ); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/number/DivFloor.ts: -------------------------------------------------------------------------------- 1 | import { Gt } from '../comp/Gt'; 2 | 3 | import { Inc } from './Inc'; 4 | import { Subtract } from './Subtract'; 5 | 6 | /** 7 | * Divide two numbers, returning the floor. 8 | */ 9 | export type DivFloor< 10 | A extends number, 11 | B extends number, 12 | Acc extends number = 0 13 | > = 14 | // @ts-ignore 15 | { 0: Acc; 1: DivFloor, B, Inc[Acc]> }[Gt]; 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/number/Pow.ts: -------------------------------------------------------------------------------- 1 | import { Matches } from '../type/Matches'; 2 | 3 | import { Dec } from './Dec'; 4 | import { Mult } from './Mult'; 5 | 6 | /** 7 | * Return the given power of a number. 8 | */ 9 | export type Pow< 10 | Base extends number, 11 | Exp extends number, 12 | Acc extends number = 1 13 | > = 14 | // @ts-ignore 15 | { 1: Acc; 0: Pow> }[Matches]; 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/DeepAssert.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Strip null/undefined from a type and all its (sub) properties. 3 | */ 4 | export type DeepAssert = T extends any[] 5 | ? DeepAssertArray 6 | : T extends object 7 | ? DeepAssertObject 8 | : NonNullable; 9 | interface DeepAssertArray extends Array> {} 10 | type DeepAssertObject = { 11 | [P in keyof T]: DeepAssert; 12 | }; 13 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /common-libs/packages/ts-color/src/color/public_api.ts: -------------------------------------------------------------------------------- 1 | import { tinycolor } from './index'; 2 | export * from './css-color-names'; 3 | export * from './format-input'; 4 | export * from './from-ratio'; 5 | export * from './index'; 6 | export * from './interfaces'; 7 | export * from './random'; 8 | export * from './readability'; 9 | export * from './to-ms-filter'; 10 | 11 | // kept for backwards compatability with v1 12 | export default tinycolor; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/AppendNumObj.ts: -------------------------------------------------------------------------------- 1 | import { NumberToString } from '../cast/NumberToString'; 2 | import { NumObj } from '../util/NumObj'; 3 | 4 | import { Length } from './Length'; 5 | 6 | /** 7 | * Append a value to the end of an object type with numerical keys 8 | */ 9 | export type AppendNumObj< 10 | R extends NumObj, 11 | T, 12 | Len extends number = Length 13 | > = R & { [P in NumberToString[Len]]: T }; 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/index.ts: -------------------------------------------------------------------------------- 1 | export { Gt } from './Gt'; 2 | export { Gte } from './Gte'; 3 | export { Lt } from './Lt'; 4 | export { Lte } from './Lte'; 5 | export { Max } from './Max'; 6 | export { Min } from './Min'; 7 | export { NumbersEqual } from './NumbersEqual'; 8 | export { StringsEqual } from './StringsEqual'; 9 | 10 | /** 11 | * Type functions comparing types. Mostly for number literals. 12 | * @preferred 13 | */ 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/ConcatNumObjs.ts: -------------------------------------------------------------------------------- 1 | import { NumObj } from '../util/NumObj'; 2 | 3 | import { IncIndexNumbObj } from './IncIndexNumbObj'; 4 | import { Length } from './Length'; 5 | 6 | /** 7 | * Concatenate the values of two object types with numerical keys, analogous to `Array.prototype.concat()` 8 | */ 9 | export type ConcatNumObjs, B extends NumObj> = A & 10 | IncIndexNumbObj>; 11 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/ds/datetime/index.ts: -------------------------------------------------------------------------------- 1 | export * from './calendar'; 2 | export * from './format'; 3 | 4 | export const now: () => number = () => Date.now(); 5 | 6 | // 从时间字符串中计算出秒数 13 : 28 : 44 7 | export function getSFromHMS(hms: string) { 8 | const hmsList = hms.replace('-', '').replace(/ /g, '').split(':'); 9 | 10 | return ( 11 | Number(hmsList[0]) * 3600 + Number(hmsList[1]) * 60 + Number(hmsList[2]) 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /common-configs/packages/tsconfig/dist/main.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"main.js","sourceRoot":"","sources":["../../vite-config/example/src/main.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,aAAa,CAAC;AACrB,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,QAAQ,CAAC,MAAM,CACb,oBAAC,KAAK,CAAC,UAAU;IACf,oBAAC,GAAG,OAAG,CACU,EACnB,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAChC,CAAC;AAEF,OAAO,CAAC,GAAG,CAAE,MAAM,CAAC,IAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"} -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/TupleTo.ts: -------------------------------------------------------------------------------- 1 | // `...` needs #5453, so syntax errors: 2 | // /** From a tuple-like type, get the subset up to a certain index. Returns a tuple type. */ 3 | // export type TupleTo, To extends number, I extends number = 0, Acc extends List=[]> = 4 | // If, { 0: Acc; 1: TupleTo; }[Matches], T>; 5 | // the<['a', 'b'], TupleTo<['a', 'b', 'c', 'd'], 2>>(); 6 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/context/ConstantFactory.ts: -------------------------------------------------------------------------------- 1 | import { DependencyIdentifier, WrappedDependency } from '../types'; 2 | 3 | export class ConstantFactory implements WrappedDependency { 4 | constructor(private identifer: DependencyIdentifier, private instance: T) {} 5 | 6 | public getInstance(): T { 7 | return this.instance; 8 | } 9 | 10 | public getIdentifier() { 11 | return this.identifer; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/scripts/webpack/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { merge } = require('webpack-merge'); 3 | 4 | const devConfig = require('../../../../scripts/webpack/webpack.config').devConfig; 5 | 6 | module.exports = merge(devConfig, { 7 | entry: { 8 | index: path.resolve(__dirname, '../../example') 9 | }, 10 | devServer: { 11 | contentBase: path.resolve(__dirname, '../../public') 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/TupleLastElem.ts: -------------------------------------------------------------------------------- 1 | import { Dec } from '../number/Dec'; 2 | import { Inc } from '../number/Inc'; 3 | import { List } from '../util/List'; 4 | 5 | import { TupleHasIndex } from './TupleHasIndex'; 6 | 7 | /** 8 | * Get the last element of a tuple-like type 9 | */ 10 | export type TupleLastElem, I extends number = 0> = { 11 | 1: TupleLastElem; 12 | 0: R[Dec[I]]; 13 | }[TupleHasIndex]; 14 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/cast/TupleToUnion.ts: -------------------------------------------------------------------------------- 1 | import { TupleHasIndex } from '../array/TupleHasIndex'; 2 | import { Inc } from '../number/Inc'; 3 | import { List } from '../util/List'; 4 | 5 | /** 6 | * Get a union of types from the elements of a tuple-like type. 7 | */ 8 | export type TupleToUnion< 9 | R extends List, 10 | I extends number = 0, 11 | Acc = never 12 | > = { 1: TupleToUnion; 0: Acc }[TupleHasIndex]; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/tuple/DifferenceLists.ts: -------------------------------------------------------------------------------- 1 | import { ListFrom } from '../array/ListFrom'; 2 | import { List } from '../util/List'; 3 | 4 | import { LengthList } from './LengthList'; 5 | 6 | /** 7 | * Filter a tuple-like type by stripping out any indices used in a second tuple-like. 8 | */ 9 | export type DifferenceLists< 10 | Big extends List, 11 | Small extends List 12 | // @ts-ignore 13 | > = ListFrom>; 14 | -------------------------------------------------------------------------------- /common-configs/packages/webpack4-config/example/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button as AntdButton } from 'antd'; 2 | import { Button as AMButton } from 'antd-mobile'; 3 | import React from 'react'; 4 | import * as ReactDOM from 'react-dom'; 5 | 6 | import './index.less'; 7 | 8 | ReactDOM.render( 9 |
10 | Ant 11 | AMButton 12 |
, 13 | document.getElementById('root'), 14 | ); 15 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/stories/index.stories.tsx: -------------------------------------------------------------------------------- 1 | import { action } from '@storybook/addon-actions'; 2 | import { storiesOf } from '@storybook/react'; 3 | import * as React from 'react'; 4 | 5 | import { Exception } from '../src/decorators/exception/Exception'; 6 | 7 | storiesOf('Exception', module).add( 8 | 'with text', 9 | () => Hello Button, 10 | { 11 | info: { inline: true }, 12 | } 13 | ); 14 | -------------------------------------------------------------------------------- /common-libs/packages/redux-middlewares/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { merge } = require('webpack-merge'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config.umd'); 5 | 6 | const rootPath = process.cwd(); 7 | 8 | module.exports = merge(umdConfig, { 9 | output: { 10 | library: 'rtwCore', 11 | }, 12 | entry: { 13 | index: path.resolve(rootPath, './src/index.ts'), 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12.16 AS JS_BUILD 2 | COPY webapp /webapp 3 | WORKDIR webapp 4 | RUN npm install && npm run build 5 | 6 | FROM golang:1.14.0-alpine AS GO_BUILD 7 | RUN apk update && apk add build-base 8 | COPY server /server 9 | WORKDIR /server 10 | RUN go build -o /go/bin/server 11 | 12 | FROM alpine:3.11 13 | COPY --from=JS_BUILD /webapp/build* ./webapp/ 14 | COPY --from=GO_BUILD /go/bin/server ./ 15 | CMD ./server 16 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | app: 4 | build: . 5 | container_name: app 6 | ports: 7 | - 8080:8080 8 | depends_on: 9 | - db 10 | environment: 11 | profile: prod 12 | db: 13 | image: mongo:4.2.3 14 | container_name: db 15 | environment: 16 | MONGO_INITDB_DATABASE: tech 17 | volumes: 18 | - ./init-db.js:/docker-entrypoint-initdb.d/init.js 19 | -------------------------------------------------------------------------------- /common-configs/packages/vite-config/example/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { merge } = require('webpack-merge'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config').umdConfig; 5 | 6 | const rootPath = process.cwd(); 7 | 8 | module.exports = merge(umdConfig, { 9 | output: { 10 | library: 'rtwComponents' 11 | }, 12 | entry: { 13 | index: path.resolve(rootPath, './src/index.ts') 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/scripts/docker/start-container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | NAME="m-fe-rtw" 3 | 4 | git pull --rebase --prune 5 | 6 | echo 'start build docker image.' 7 | docker build -t ${NAME}:latest -f ./scripts/docker/Dockerfile dist 8 | 9 | echo 'stop and remove the current container.' 10 | docker container stop ${NAME} 11 | docker container rm ${NAME} 12 | 13 | echo 'run a new container.' 14 | docker run -d --restart always -p 2015:2015 --name ${NAME} ${NAME}:latest 15 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/demo/controller/AnnouncementControllerDoc.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import AnnouncementInterfaceEntity from "../entity/auth/AnnouncementInterfaceEntity"; 4 | import { apiResponse } from "../../src/swagger/decorator"; 5 | export default class AnnouncementControllerDoc { 6 | @apiResponse(200, "get users successfully", [AnnouncementInterfaceEntity]) 7 | static async getAnnouncements(ctx, next): [AnnouncementInterfaceEntity] {} 8 | } 9 | -------------------------------------------------------------------------------- /common-libs/packages/typed-entity-decorators/src/decorator-x/test/transform/entity/flow/TestEntity.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import AnotherEntity from "./AnotherEntity"; 4 | 5 | class Entity { 6 | // Comment 7 | stringProperty: string = 0; 8 | 9 | classProperty: Entity = null; 10 | 11 | rawProperty; 12 | 13 | @entityProperty({ 14 | type: "string", 15 | description: "this is property description", 16 | required: true 17 | }) 18 | decoratedProperty; 19 | } 20 | -------------------------------------------------------------------------------- /common-scaffold/docs-generator/website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "examples": "docusaurus-examples", 4 | "start": "docusaurus-start", 5 | "build": "docusaurus-build", 6 | "publish-gh-pages": "docusaurus-publish", 7 | "write-translations": "docusaurus-write-translations", 8 | "version": "docusaurus-version", 9 | "rename-version": "docusaurus-rename-version" 10 | }, 11 | "devDependencies": { 12 | "docusaurus": "^1.14.4" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common-configs/packages/browserslist-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@m-fe/browserslist-config", 3 | "version": "0.0.1", 4 | "description": "Shareable Browserslist Configuration for all micro-frontend projects.", 5 | "repository": "https://github.com/wx-chevalier/m-fe-configs", 6 | "author": "wx-chevalier", 7 | "license": "MIT", 8 | "peerDependencies": { 9 | "browserslist": "^4.7.0" 10 | }, 11 | "publishConfig": { 12 | "access": "public" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common-configs/packages/tslint-config/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/tslint", 3 | "extends": ["./tslint.json", "tslint-angular", "tslint-config-prettier"], 4 | "rules": { 5 | "component-selector": [true, "element", "rx", "kebab-case"], 6 | "directive-selector": [true, "attribute", "rx", "camelCase"], 7 | "no-input-rename": false, 8 | "template-no-negated-async": false, 9 | "use-component-view-encapsulation": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/.storybook/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ config }) => { 2 | config.module.rules.push({ 3 | test: /\.(ts|tsx)$/, 4 | use: [ 5 | { 6 | loader: require.resolve('awesome-typescript-loader') 7 | }, 8 | // Optional 9 | { 10 | loader: require.resolve('react-docgen-typescript-loader') 11 | } 12 | ] 13 | }); 14 | config.resolve.extensions.push('.ts', '.tsx'); 15 | return config; 16 | }; 17 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/array/FixedSizeArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * we use numeric literal types for length as TS 2.7 does for fixed size tuples 3 | * @param N the length of the array 4 | * @param T the type of array elements 5 | * @param M a dummy type inizialized to '0', we need it to trick the compiler 6 | * @see https://github.com/mstn/fixed-size-array/ 7 | */ 8 | export type FixedSizeArray = { 9 | 0: any; 10 | length: N; 11 | } & ReadonlyArray; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/cast/TupleIndicesToUnion.ts: -------------------------------------------------------------------------------- 1 | import { TupleHasIndex } from '../array/TupleHasIndex'; 2 | import { Inc } from '../number/Inc'; 3 | import { List } from '../util/List'; 4 | 5 | /** 6 | * Get a union of types from the indices of a tuple-like type. 7 | */ 8 | export type TupleIndicesToUnion< 9 | R extends List, 10 | I extends number = 0, 11 | Acc = never 12 | > = { 1: TupleIndicesToUnion; 0: Acc }[TupleHasIndex]; 13 | -------------------------------------------------------------------------------- /common-libs/packages/ts-utils/src/types/basic/ObservableLike.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface SymbolConstructor { 3 | readonly observable: symbol; 4 | } 5 | } 6 | 7 | /** 8 | Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). 9 | @category Basic 10 | */ 11 | export interface ObservableLike { 12 | subscribe(observer: (value: ValueType) => void): void; 13 | [Symbol.observable](): ObservableLike; 14 | } 15 | -------------------------------------------------------------------------------- /common-scaffold/go-code-generator/templates/angular.webapp/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const merge = require('webpack-merge'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | const rootPath = process.cwd(); 8 | 9 | module.exports = merge(umdConfig, { 10 | output: { 11 | library: 'rtwCore', 12 | }, 13 | entry: { 14 | index: path.resolve(rootPath, './src/index.ts'), 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /common-libs/packages/google-translate/.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | browser: true 3 | commonjs: true 4 | es6: true 5 | node: true 6 | extends: "eslint:recommended" 7 | globals: 8 | Atomics: readonly 9 | SharedArrayBuffer: readonly 10 | parserOptions: 11 | ecmaVersion: 2022 12 | rules: 13 | indent: 14 | - error 15 | - 4 16 | linebreak-style: 17 | - error 18 | - unix 19 | quotes: 20 | - error 21 | - double 22 | semi: 23 | - error 24 | - always 25 | -------------------------------------------------------------------------------- /common-libs/packages/react-commons/src/types/module.ts: -------------------------------------------------------------------------------- 1 | import { ComponentType } from 'react'; 2 | 3 | export interface ResolvedModule { 4 | default: ComponentType; 5 | reducer?: Record; 6 | } 7 | 8 | export interface Module { 9 | id: string; 10 | getName: () => string; 11 | type: 'page' | 'module' | 'app' | 'widget' | 'extension'; 12 | 13 | getMenu?: () => {}; 14 | component?: React.ComponentType; 15 | loader?: () => Promise; 16 | } 17 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/object/HasKey.ts: -------------------------------------------------------------------------------- 1 | import { TupleHasIndex } from '../array/TupleHasIndex'; 2 | import { Intersection } from '../util/Intersection'; 3 | 4 | import { ObjectHasKey } from './ObjectHasKey'; 5 | 6 | /** 7 | * Check if a type (object or tuple) has a certain key. 8 | */ 9 | export type HasKey = T extends any[] 10 | ? TupleHasIndex> 11 | : ObjectHasKey>; 12 | -------------------------------------------------------------------------------- /common-scaffold/node-cli/packages/mfs-cli/src/constant/types.ts: -------------------------------------------------------------------------------- 1 | export interface IBasicModule { 2 | // 模块编号 3 | id: string; 4 | // 模块的加载文件路径 5 | module: string; 6 | // 版本 7 | version?: string; 8 | } 9 | 10 | export interface IAppModule extends IBasicModule { 11 | // 模块标题 12 | name: string; 13 | // 引入的 CSS 路径 14 | css?: string | string[]; 15 | } 16 | 17 | /** 初始化参数 */ 18 | export interface IInitOption { 19 | apps: IAppModule[]; 20 | vendors?: IBasicModule[]; 21 | } 22 | -------------------------------------------------------------------------------- /common-configs/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const { allowModules } = require('@m-fe/eslint-config/_util'); 2 | 3 | module.exports = { 4 | extends: '@m-fe/eslint-config', 5 | settings: { 6 | node: { 7 | allowModules: allowModules.concat('tslint', 'typescript'), 8 | }, 9 | polyfills: [ 10 | 'console', 11 | 'Array.isArray', 12 | 'JSON', 13 | 'Object.assign', 14 | 'Object.entries', 15 | 'Object.keys', 16 | 'Promise', 17 | ], 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /common-configs/tests/test.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'x' { 2 | namespace X { 3 | interface Options { 4 | prop: string 5 | } 6 | 7 | type Comp = React.ComponentType & {} 8 | } 9 | 10 | export = X 11 | } 12 | 13 | declare module 'y' { 14 | namespace Y { 15 | type Comp = React.ComponentType & {} 16 | } 17 | 18 | export = Y 19 | } 20 | 21 | declare module 'z' { 22 | namespace Z { 23 | type Comp = React.ComponentType & {} 24 | } 25 | 26 | export = Z 27 | } 28 | -------------------------------------------------------------------------------- /common-libs/packages/style-preset/less/mixins/label.less: -------------------------------------------------------------------------------- 1 | #label { 2 | 3 | .default-styles() { 4 | font-weight: 500; 5 | display: block; 6 | cursor: pointer; 7 | font-family: @primary-font; 8 | } 9 | 10 | .default(@fs: 1rem) when (default()) { 11 | .default-styles(); 12 | font-size: @fs; 13 | } 14 | 15 | .default(@type, @fs: 1rem) when (@type = bold) { 16 | .default-styles(); 17 | font-size: @fs; 18 | font-weight: bold; 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/comp/NumbersEqual.ts: -------------------------------------------------------------------------------- 1 | import { DefinitelyYes } from '../boolean/DefinitelyYes'; 2 | import { NumberToString } from '../cast/NumberToString'; 3 | import { StringsEqual } from '../comp/StringsEqual'; 4 | 5 | /** 6 | * Check whether two number literal types are equivalent. 7 | * @deprecated ditch for Matches 8 | */ 9 | export type NumbersEqual
= DefinitelyYes< 10 | StringsEqual 11 | >; 12 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/src/util/index.ts: -------------------------------------------------------------------------------- 1 | export { Bool } from './Bool'; 2 | export { If } from './If'; 3 | export { Intersection } from './Intersection'; 4 | export { List } from './List'; 5 | export { NoInfer } from './NoInfer'; 6 | export { NumObj } from './NumObj'; 7 | export { Obj } from './Obj'; 8 | export { The } from './The'; 9 | export { Unknown } from './Unknown'; 10 | 11 | /** 12 | * General utilities that seemed not to fit in the other modules. 13 | * @preferred 14 | */ 15 | -------------------------------------------------------------------------------- /common-libs/packages/address.ts/README.md: -------------------------------------------------------------------------------- 1 | # @m-fe/utils 2 | 3 | Utils for JavaScript data structures, funcs and dom elements manipulation, etc. 4 | 5 | # Usage 6 | 7 | # Development 8 | 9 | # About 10 | 11 | # Motivation & Credits 12 | 13 | - [fbjs #Project#](https://github.com/facebook/fbjs): A collection of utility libraries used by other Facebook JS projects. 14 | 15 | - https://github.com/sveltejs/svelte/blob/master/src/runtime/internal/dom.ts 16 | 17 | - https://github.com/jhdevuk/tsdom 18 | -------------------------------------------------------------------------------- /common-libs/packages/ts-types/README.md: -------------------------------------------------------------------------------- 1 | # @m-fe/utils 2 | 3 | Utils for JavaScript data structures, funcs and dom elements manipulation, etc. 4 | 5 | # Usage 6 | 7 | # Development 8 | 9 | # About 10 | 11 | # Motivation & Credits 12 | 13 | - [fbjs #Project#](https://github.com/facebook/fbjs): A collection of utility libraries used by other Facebook JS projects. 14 | 15 | - https://github.com/sveltejs/svelte/blob/master/src/runtime/internal/dom.ts 16 | 17 | - https://github.com/jhdevuk/tsdom 18 | -------------------------------------------------------------------------------- /common-configs/packages/webpack-config/example/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button as AntdButton } from 'antd'; 2 | import { Button as AMButton } from 'antd-mobile'; 3 | import React from 'react'; 4 | import * as ReactDOM from 'react-dom'; 5 | 6 | import 'normalize.css'; 7 | 8 | import './index.less'; 9 | 10 | ReactDOM.render( 11 |
12 | Ant 13 | AMButton 14 |
, 15 | document.getElementById('root'), 16 | ); 17 | --------------------------------------------------------------------------------