Skip to content

Commit

Permalink
Use main branch for contracts until release
Browse files Browse the repository at this point in the history
  • Loading branch information
ericglau committed Jun 2, 2022
1 parent 08b156c commit 18dae85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core-cairo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export { OptionsError } from './error';
export type { Kind } from './kind';
export { sanitizeKind } from './kind';

export { contractsVersion } from './utils/version';
export { contractsVersion, contractsVersionTag } from './utils/version';
3 changes: 2 additions & 1 deletion packages/core-cairo/src/utils/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const contractsVersion = "0.1.0";
export const contractsVersion = '0.2.0';
export const contractsVersionTag = 'main'; // TODO revert this for release: `v${contractsVersion}`;
4 changes: 2 additions & 2 deletions packages/ui/src/cairo/inject-hyperlinks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { contractsVersion } from "@openzeppelin/wizard-cairo/src";
import { contractsVersionTag } from "@openzeppelin/wizard-cairo/src";

export function injectHyperlinks(code: string) {
const importRegex = /( )(openzeppelin|starkware)([^\s]*)( )/g
Expand All @@ -9,7 +9,7 @@ export function injectHyperlinks(code: string) {
if (line !== undefined && spaceBefore !== undefined && libraryPrefix !== undefined && libraryPath !== undefined && spaceAfter !== undefined) {
const libraryRelativePath = libraryPath.replace(/\./g, '/');
const githubPrefix = (libraryPrefix === 'openzeppelin') ?
`https://github.com/OpenZeppelin/cairo-contracts/blob/v${contractsVersion}/src/` :
`https://github.com/OpenZeppelin/cairo-contracts/blob/${contractsVersionTag}/src/` :
'https://github.com/starkware-libs/cairo-lang/blob/master/src/';
const replacedImportLine = `${spaceBefore}<a class="import-link" href='${githubPrefix}${libraryPrefix}${libraryRelativePath}.cairo' target='_blank' rel='noopener noreferrer'>${libraryPrefix}${libraryPath}</a>${spaceAfter}`;
result = result.replace(line, replacedImportLine);
Expand Down

0 comments on commit 18dae85

Please sign in to comment.