@macrowing/inbiz-codegen 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@macrowing/inbiz-codegen",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "InBiz 出码脚手架 CLI:拉取应用 → 生成工程 → 模板升级 → 本地运行",
5
5
  "type": "module",
6
6
  "bin": {
@@ -108,6 +108,27 @@ INBIZ_PREVIEW_PASSWORD=
108
108
  `;
109
109
  }
110
110
 
111
+ /**
112
+ * 工程的 `.npmrc`。
113
+ *
114
+ * 必须由 init 生成,不能放模板文件里:**npm 打包时会强制排除 `.npmrc`**,
115
+ * 放模板里发布出去就丢了,生成的项目会缺 scoped registry 配置,
116
+ * 表现为装 `@macrowing/*` 时 404 或 EALLOWREMOTE。
117
+ */
118
+ const NPMRC_CONTENT = `# 组件包与运行时包都发布在 npmjs 的 @macrowing scope 下,其余依赖走镜像。
119
+ @macrowing:registry=https://registry.npmjs.org/
120
+ registry=https://registry.npmmirror.com/
121
+
122
+ # 组件库大量依赖与工程 peer 版本不一致,按 npm 的 legacy 语义安装。
123
+ legacy-peer-deps=true
124
+ install-links=true
125
+
126
+ # npm 12 起 allow-remote 默认 none。@macrowing 的元数据取自 npmjs,
127
+ # 但镜像会把 dist.tarball 改写到 npmmirror 域名,跨源下载会被判定为
128
+ # "remote" 而拒绝(EALLOWREMOTE)。显式放开,避免重装时卡在这一步。
129
+ allow-remote=all
130
+ `;
131
+
111
132
  /**
112
133
  * 默认转发前缀:只保留平台自身的通用入口。
113
134
  *
@@ -175,6 +196,7 @@ export function runInit(options) {
175
196
  }
176
197
 
177
198
  const extra = {
199
+ '.npmrc': NPMRC_CONTENT,
178
200
  '.env': envFile({
179
201
  appId, siteType, siteOutId, dataVersionId, serverUrl, port: resolvedPort, basePath, proxyPrefixes,
180
202
  }),