@michaeltangseng/schemaai 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/publish-to-npm.md
CHANGED
|
@@ -98,7 +98,30 @@ npm install @michaeltangseng/schemaai
|
|
|
98
98
|
pnpm add @michaeltangseng/schemaai
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
注意:
|
|
102
|
+
报错403 ... Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages.
|
|
103
|
+
解决方法:
|
|
104
|
+
1. 使用一次性 OTP 发布(最直接)
|
|
105
|
+
打开 npmjs.com,登录你的账号。
|
|
106
|
+
进入 Account Settings → Authentication,确认 2FA 已启用。
|
|
107
|
+
在终端再次执行发布命令时,带上 --otp,并输入手机/App 上生成的 2FA 验证码:
|
|
108
|
+
cd Others/utils-lib/npm-package
|
|
109
|
+
npm publish --access public --otp=你的6位验证码
|
|
110
|
+
|
|
111
|
+
2. 使用带 bypass 2FA 的 npm Access Token(更适合 CI/频繁发布)
|
|
112
|
+
登录 npm 官网 → Access Tokens。
|
|
113
|
+
创建一个 Granular Access Token,勾选:
|
|
114
|
+
作用范围:Publish packages(或至少对 @michaeltangseng/* 有 publish 权限)
|
|
115
|
+
选项:允许 “bypass 2FA for publishing”(名称会类似 Publish without 2FA)。
|
|
116
|
+
在终端设置环境变量使用这个 token 发布:
|
|
117
|
+
export NPM_TOKEN=你的_token
|
|
118
|
+
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
|
|
119
|
+
cd Others/utils-lib/npm-package
|
|
120
|
+
npm publish --access public
|
|
121
|
+
|
|
122
|
+
|
|
101
123
|
然后在代码中使用:
|
|
124
|
+
先安装: pnpm add @michaeltangseng/schemaai
|
|
102
125
|
|
|
103
126
|
```ts
|
|
104
127
|
import { schemaAIRenderer as SchemaAIRenderer } from '@michaeltangseng/schemaai';
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michaeltangseng/schemaai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "schemaAI - React schema-driven low-code engine core (extracted from react-low-code-engine).",
|
|
5
5
|
"private": false,
|
|
6
|
-
"main": "dist/index.
|
|
7
|
-
"module": "dist/index.
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"scripts": {
|
|
@@ -8,6 +8,9 @@ importers:
|
|
|
8
8
|
|
|
9
9
|
.:
|
|
10
10
|
dependencies:
|
|
11
|
+
'@michaeltangseng/schemaai':
|
|
12
|
+
specifier: ^0.0.1
|
|
13
|
+
version: 0.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
|
11
14
|
react:
|
|
12
15
|
specifier: ^18.3.1
|
|
13
16
|
version: 18.3.1
|
|
@@ -171,6 +174,12 @@ packages:
|
|
|
171
174
|
cpu: [x64]
|
|
172
175
|
os: [win32]
|
|
173
176
|
|
|
177
|
+
'@michaeltangseng/schemaai@0.0.1':
|
|
178
|
+
resolution: {integrity: sha512-2+oAlQ36gbNyzvgbKHrJHRK/WtJPHmbqw4z+vd2v9idQc2JiTe8JDS790lIsv+4LNpR00ug8J5l8drSkmsBW5Q==}
|
|
179
|
+
peerDependencies:
|
|
180
|
+
react: ^18.0.0
|
|
181
|
+
react-dom: ^18.0.0
|
|
182
|
+
|
|
174
183
|
'@rolldown/pluginutils@1.0.0-beta.27':
|
|
175
184
|
resolution: {integrity: sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==}
|
|
176
185
|
|
|
@@ -553,6 +562,11 @@ snapshots:
|
|
|
553
562
|
'@esbuild/win32-x64@0.21.5':
|
|
554
563
|
optional: true
|
|
555
564
|
|
|
565
|
+
'@michaeltangseng/schemaai@0.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
|
|
566
|
+
dependencies:
|
|
567
|
+
react: 18.3.1
|
|
568
|
+
react-dom: 18.3.1(react@18.3.1)
|
|
569
|
+
|
|
556
570
|
'@rolldown/pluginutils@1.0.0-beta.27': {}
|
|
557
571
|
|
|
558
572
|
'@rollup/rollup-android-arm-eabi@4.59.0':
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import SchemaAIRenderer from '../../../src/renderer/Renderer';
|
|
2
|
+
// import SchemaAIRenderer from '../../../src/renderer/Renderer';
|
|
3
|
+
import { schemaAIRenderer as SchemaAIRenderer } from '@michaeltangseng/schemaai';
|
|
3
4
|
// 如需测试通过 npm 包名导入(@michaeltangseng/schemaai),
|
|
4
5
|
// 请在发布到 npm 并在独立项目中安装后再切换为包名导入。
|
|
5
6
|
|