-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Pin @a2ui/web_core versions and configure React for publishing #996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e07ba22
6529d4e
d9bc710
356c5ad
9da9447
0929212
e327f39
e6b48ed
7d5d5db
6310f2e
a4aa806
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| @a2ui:registry=https://us-npm.pkg.dev/oss-exit-gate-prod/a2ui--npm/ | ||
| //us-npm.pkg.dev/oss-exit-gate-prod/a2ui--npm/:always-auth=true | ||
| @a2ui:registry=https://us-npm.pkg.dev/oss-exit-gate-prod/lit--npm/ | ||
| //us-npm.pkg.dev/oss-exit-gate-prod/lit--npm/:always-auth=true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,112 @@ | ||||||||
| /** | ||||||||
| * Copyright 2026 Google LLC | ||||||||
jacobsimionato marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
| * | ||||||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||
| * you may not use this file except in compliance with the License. | ||||||||
| * You may obtain a copy of the License at | ||||||||
| * | ||||||||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||||||||
| * | ||||||||
| * Unless required by applicable law or agreed to in writing, software | ||||||||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||||||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||
| * See the License for the specific language governing permissions and | ||||||||
| * limitations under the License. | ||||||||
| */ | ||||||||
|
|
||||||||
| import { readFileSync, writeFileSync, copyFileSync, mkdirSync, existsSync } from 'fs'; | ||||||||
| import { join } from 'path'; | ||||||||
|
|
||||||||
| // This script prepares the React package for publishing by: | ||||||||
| // 1. Copying package.json to dist/ | ||||||||
| // 2. Updating @a2ui/web_core dependency from 'file:...' to the actual exact version | ||||||||
| // 3. Adjusting paths in package.json (main, types, exports) to be relative to dist/ | ||||||||
|
|
||||||||
| const dirname = import.meta.dirname; | ||||||||
| const corePkgPath = join(dirname, '../../web_core/package.json'); | ||||||||
| const pkgPath = join(dirname, '../package.json'); | ||||||||
| const distDir = join(dirname, '../dist'); | ||||||||
|
|
||||||||
| if (!existsSync(distDir)) { | ||||||||
| mkdirSync(distDir, { recursive: true }); | ||||||||
| } | ||||||||
|
|
||||||||
| // 1. Get Core Version | ||||||||
| const corePkg = JSON.parse(readFileSync(corePkgPath, 'utf8')); | ||||||||
| const coreVersion = corePkg.version; | ||||||||
| if (!coreVersion) throw new Error('Cannot determine @a2ui/web_core version'); | ||||||||
|
|
||||||||
| // 2. Read Package | ||||||||
| const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')); | ||||||||
|
|
||||||||
| // 3. Update Dependency | ||||||||
| if (pkg.dependencies && pkg.dependencies['@a2ui/web_core']) { | ||||||||
| pkg.dependencies['@a2ui/web_core'] = coreVersion; | ||||||||
| } else { | ||||||||
| console.warn('Warning: @a2ui/web_core not found in dependencies.'); | ||||||||
|
||||||||
| } else { | |
| console.warn('Warning: @a2ui/web_core not found in dependencies.'); | |
| throw new Error('Error: @a2ui/web_core not found in dependencies. This is a mandatory dependency for publishing.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Uh oh!
There was an error while loading. Please reload this page.