New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

c3dxstate2

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c3dxstate2

This is the EasyGameFramework library template project

latest
Source
npmnpm
Version
1.1.9
Version published
Maintainers
1
Created
Source

@ailhc/xstate2c3d

将xstate转为systemjs规范给c3d使用

问题

因为xstate非web版引用了node的变量: progress.env 解决方案

  • 对xstate的package.json做了些许改动,让main指向 xstate.web.js,因为xstate非web版有些变量会导致运行报错,删除module字段
  • 修改生成后的index.js
exports({
        ActionTypes: void 0,
        InterpreterStatus: void 0,
        Machine: Machine,
        SpecialTargets: void 0,
        createMachine: createMachine,
        doneInvoke: doneInvoke,
        forwardTo: forwardTo,
        interpret: interpret,
        mapState: mapState,
        matchState: matchState,
        matchesState: matchesState,
        send: send$1,
        sendParent: sendParent,
        sendUpdate: sendUpdate,
        spawn: spawn
      });
      var process = { env: { NODE_ENV: "production" } }

使用

复制dist/system文件夹下lib和types到c3d项目,将index.js设置为插件 在任意脚本引用就可以

import { createMachine, interpret } from "@ailhc/xstate2c3d"

Keywords

statemachine

FAQs

Package last updated on 10 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts