npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sohu-lowcode-materials

v1.2.4

Published

Fusion Next for LowCode

Downloads

12

Readme

NPM version

在线示例 / DEMO

使用 / Usage

NPM

const { material } from '@alilc/lowcode-engine';
const assets = require('@alilc/lowcode-materials/dist/assets.json');

// in GeneralWorkbench init
material.setAssets(assets);

CDN

// in GeneralWorkbench init
const assets = await (await fetch(`https://alifd.alicdn.com/npm/@alilc/[email protected]/dist/assets.json`)).json();
material.setAssets(assets);

windows平台./tmp/view.js路径报错的问题解决

在npm install之后可以看到

\node_modules@alifd\build-plugin-lowcode\src\index.js是生成view.js的逻辑

如下代码:(注释那两行是需要修改的地方)

  { 
    ....
    // default 不一定存在,export { default } 不安全可能会报错
    componentViewsExportStr += `\nconst entryDefault = componentInstances.default;\nexport { entryDefault as default }`;
    componentViewsImportStr = _componentViews
      .map((component) => {
        const componentNameFolder = camel2KebabComponentName(component);
        let viewJsPath = path.resolve(rootDir, `${lowcodeDir}/${componentNameFolder}/view`); // const改为let
        viewJsPath = viewJsPath.replace(/\\/g, '\\\\'); // 修改成这样!!!!
        return `import * as ${component}Data from '${viewJsPath}'`;
      })
      .join('\n');
  }
  const scssEntry = getScssEntry(rootDir);
  const viewPath = generateEntry({
    template: 'view.js',
    filename: 'view.js',
    rootDir,
    params: {
      entryPath: getEntry(rootDir, entryPath),
      scssImport: scssEntry ? `import '${scssEntry}'` : '',
      componentViews,
      componentViewsExportStr,
      componentViewsImportStr,
      library,
      execCompile,
    },
  });

代码提交检查不过的问题

如果是阿里官方组件代码,建议在.eslintignore文件里添加相关组件代码所在目录的路径,这样处理风险最小

物料在平台本地环境的调试

第一步:启动物料的本地开发环境和平台的本地开发环境

第二步:复制或者替换如下package和component信息到平台的/services/assets.json文件中

// package, package,version信息与物料的packages.json保持一致,library与asset-dev.json保持一致
{
  "package": "sohu-lowcode-materials",
  "version": "1.2.3",
  "library": "SohuLowcodeMaterials",
  "urls": [
    "http://localhost:3333/build/lowcode/render/default/view.js",
    "http://localhost:3333/build/lowcode/render/default/view.css"
  ],
  "editUrls": [
    "http://localhost:3333/build/lowcode/render/default/view.js",
    "http://localhost:3333/build/lowcode/render/default/view.css"
  ],
  "advancedUrls": {
    "default": [
      "http://localhost:3333/build/lowcode/render/default/view.js",
      "http://localhost:3333/build/lowcode/render/default/view.css"
    ]
  },
  "advancedEditUrls": {}
},
// component, package,version信息与物料的packages.json保持一致,exportName与asset-dev.json保持一致
{
  "exportName": "SohuLowcodeMaterialsMeta",
  "npm": {
    "package": "sohu-lowcode-materials",
    "version": "1.2.3"
  },
  "url": "http://localhost:3333/build/lowcode/meta.js",
  "urls": {
    "default": "http://localhost:3333/build/lowcode/meta.js",
    "design": "http://localhost:3333/build/lowcode/meta.design.js"
  },
  "advancedUrls": {
    "default": [
      "http://localhost:3333/build/lowcode/meta.js"
    ],
    "design": [
      "http://localhost:3333/build/lowcode/meta.design.js"
    ]
  }
},