open-index/open-npm huggingface dataset:
npm package: @lenslayers/nuxt-test
Description: LensLayers Nuxt layer
Author: j0hnfl0w
Latest version: 0.0.3

# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# yarn
yarn install

# npm
npm install

# pnpm
pnpm install --shamefully-hoist
```

## Development Server

Start the development server on http://localhost:3000

```bash
npm run dev
```

## Production

Build the application for production:

```bash
npm run build
```

Locally preview production build:

```bash
npm run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
npm package: @lensung/cli
Description: 提供通用的前端工程化能力
Author: chenyueban
Latest version: 0.0.6

# @lensung/cli

提供通用的前端工程化能力

欢迎将你希望的功能通过 Issue 或 PR 的形式提供给本项目

## 安装

```bash
npm install -g @lensung/cli taobaodev
```

or

```bash
yarn global add @lensung/cli taobaodev
```

## 使用

执行命令 `lensung`

## 功能

### dev

实现了 打包环节可控的代码压缩、图片优化、生产环境去 console、less 等前端工程化能力。

结合 [taobaodev](https://miniapp.open.taobao.com/docV3.htm?docId=119659&docType=1) 实现了完整小程序开发调试打包工具。

使用流程：

1. [仅首次使用需要] 项目根目录内 选择 `[dev]` 执行 `[login]` 登录淘宝账号
2. [仅首次使用需要] 执行 `[init]` 初始化
3. [仅首次使用需要] 执行 `[bind]` 绑定对应小程序
4. 选择需要的开发流程 `[dev]`/`[preview]`/`[debug]`/`[upload]`
5. 使用小程序开发者工具 打开项目内的 dist 目录进行开发

- [dev]: 开发使用，运行后将监控项目内文件改动，实时处理并打包至 dist 目录中
- [preview]: 调试使用，运行后将文件打包至 dist 目录中
- [debug]: 调试使用，运行后将文件打包至 dist 目录中
- [upload]: 发版使用，运行后将文件打包至 dist 目录中。唯一的生产环境，将进行代码压缩、去 console 等操作

注意：

1. 默认加入了 Less 支持，原有 acss 文件更改后缀名为 less 即可使用
2. 加入了预处理环境变量，`process.env.NODE_ENV`，可在程序内使用这个变量判断是开发环境 or 生产环境
3. 项目中可能有 local-webview，这种情况下调试前需要先打包 local-webview。可创建配置文件 `lensung.config.js`，写入以下配置(npm scripts)，这样脚手架会在打包前执行指定的 npm scripts。

```js
module.exports = {
  development: {
    beforeBuild: 'preview',
  },
  production: {
    beforeBuild: 'package',
  },
}
```

### git

快速获取当前目录下当前用户的提交记录

### prettier

选择目录与文件类型 进行批量格式化

上下进行选择、空格选中、a 键全选

目前支持的文件类型：

- js,jsx,sjs
- ts,tsx
- css,acss
- less
- scss
- html
- axml
- md
- json
- vue
npm package: @lensung/deploy
Description: [![NPM version](https://img.shields.io/npm/v/deploy?color=a1b858&label=)](https://www.npmjs.com/package/deploy)
Author: chenyueban
Latest version: 0.11.0

# deploy

[![NPM version](https://img.shields.io/npm/v/deploy?color=a1b858&label=)](https://www.npmjs.com/package/deploy)

```ts
const a = 1
```

## License

[MIT](./LICENSE) License © 2022 [chenyueban](https://github.com/chenyueban)
npm package: @lensung/lint
Description: Lint Sharable Configurations and Rules
Author: chenyueban
Latest version: 0.1.1

# lint

## 使用

1. 安装 `@lensung/lint`

```sh
npm install --save-dev @lensung/lint
# or
yarn add @lensung/lint -D
```

2. 将在根目录下自动生成一下文件 .eslintrc.json/.prettierrc.json/.lintstagedrc.json/.husky/.commitlintrc.json (注意如果已有相应文件不会覆盖)

3. 可修改规则

in `.eslintrc.json`

```json
{
  "extends": "./node_modules/@lensung/lint/src/eslint.js",
  "rules": {}
}
```

可选择使用 eslint strict 规则，将启用 airbnb 严格规则约束。

```json
{
  "extends": "./node_modules/@lensung/lint/src/eslint.strict.js",
  "rules": {}
}
```

in `.lintstagedrc.json`

```json
{
  "*.{less,sass,scss,md,json,yml}": ["prettier --write", "git add"],
  "*.{js,jsx,html}": ["prettier --write", "eslint --fix", "git add"],
  "*.ts?(x)": [
    "prettier --parser=typescript --write",
    "eslint --fix",
    "git add"
  ]
}
```

## 注意

Mac os 可能不执行 lint, 请执行以下命令:

```bash
chmod ug+x .husky/*
chmod ug+x .git/hooks/*
```

## CHANGELOG

[CHANGELOG](./CHANGELOG.md)

## LICENSE

[MIT](./LICENSE)
npm package: @lensung/miniapp-rematch
Description: 让你的支付宝小程序接入 [rematch](https://github.com/rematch/rematch)。
Author: chenyueban
Latest version: 0.0.2

# @lensung/miniapp-rematch

让你的支付宝小程序接入 [rematch](https://github.com/rematch/rematch)。

## 安装

```bash
npm install @lensung/miniapp-rematch
```

or

```bash
yarn add @lensung/miniapp-rematch
```

## 使用

1. 创建 [models](https://rematchjs.org/docs/api-reference/models)

```javascript
// count.js

export const count = {
  state: 0, // initial state
  reducers: {
    // handle state changes with pure functions
    increment(state, payload) {
      return state + payload
    },
  },
  effects: (dispatch) => ({
    // handle state changes with impure functions.
    // use async/await for async actions
    async incrementAsync(payload, rootState) {
      await new Promise((resolve) => setTimeout(resolve, 1000))
      dispatch.count.increment(payload)
    },
  }),
}
```

最佳实践是创建 models 文件夹，创建文件 `index.js`

```javascript
// index.js

export * from './count'
export * from './xxx'
```

2. 初始化 store 在 `app.js` 中

```javascript
import { initStore, Provider } from '@lensung/miniapp-rematch'
import * as models from './models' // 第 1 步中创建的 models 文件夹

const store = initStore({ models })

App(
  Provider(store)({
    onLaunch() {
      // ...
    }
  })
)
```

3. 在你的 Page 文件或 Component 文件内 connect

```javascript
import { connect } from '@lensung/miniapp-rematch'

const mapState = (state) => ({
  count: state.count,
})
const mapDispatch = (dispatch) => ({
  increment: () => dispatch.count.increment(1),
  incrementAsync: () => dispatch.count.incrementAsync(1),
})

Page(
  connect(
    mapState,
    mapDispatch
  )({
    data: {},
    onLoad() {},
    // ...
  })
)
```

至此 `@lensung/miniapp-rematch` 会帮你把 mapState 返回的 state 绑定到 Page 组件的 data 上，store 更新时 data 也会自动更新。

至于 mapDispatch 返回的 dispatch，Page 组件会将 dispatch 注入上 this 上下文中，Component 组件则会注入到 methods 中。
npm package: @lensung/tsconfig
Description: tsconfig.json inheritance via Node.js packages
Author: chenyueban
Latest version: 0.1.1

# tsconfig

[![NPM Version](https://badge.fury.io/js/%40lensung%2Ftsconfig.svg)](https://www.npmjs.com/package/@lensung/tsconfig)
[![npm (tag)](https://img.shields.io/npm/v/%40lensung/tsconfig/next.svg)](https://www.npmjs.com/package/@lensung/tsconfig?activeTab=versions)

Clone from [tsconfig](https://github.com/Chatie/tsconfig).

Reusable TypeScript configuration files to extend from.

This module enables other module to inheritance tsconfig.json via Node.js packages

## USAGE

Extends from `@lensung/tsconfig` from your tsconfig.json, to have the lensung version of the TypeScript Configuration.

### CAUTION

Do not put any directory related configurations into this module.
Only put directory related configurations to the consumer of this module.

Because all directory in tsconfig.json is related to the curfrent directory.

## SEE ALSO

- [TypeScript 3.2 - tsconfig.json inheritance via Node.js packages](https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#tsconfigjson-inheritance-via-nodejs-packages)

> TypeScript 3.2 now resolves tsconfig.jsons from node_modules. When using a bare path for the "extends" field in tsconfig.json, TypeScript will dive into node_modules packages for us.
>
> ```json
> {
>     "extends": "@my-team/tsconfig-base",
>     "include": ["./**/*"]
>     "compilerOptions": {
>         // Override certain options on a project-by-project basis.
>         "strictBindCallApply": false,
>     }
> }
> ```
>
> Here, TypeScript will climb up node_modules folders looking for a @my-team/tsconfig-base package. For each of those packages, TypeScript will first check whether package.json contains a "tsconfig" field, and if it does, TypeScript will try to load a configuration file from that field. If neither exists, TypeScript will try to read from a tsconfig.json at the root. This is similar to the lookup process for .js files in packages that Node uses, and the .d.ts lookup process that TypeScript already uses.
>
> This feature can be extremely useful for bigger organizations, or projects with lots of distributed dependencies.

## DEPENDENCES

This module will run a unit test before it could be able to publish to NPM.

The unit test load tsconfig schema from [JSON Schema Store](http://schemastore.org/) and then use [is-my-json-valid](https://www.npmjs.com/package/is-my-json-valid) to validate it.