-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Setup publishing for the first set of packages
- Loading branch information
Showing
7 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env node | ||
import fs from 'node:fs' | ||
|
||
/** | ||
* This is used to workaround the fact that many applications such as | ||
* webpack does not natively know how to import / bundle JSON files | ||
* And we also don't want to use something ugly heavy handed like a roll up | ||
* So simpliest solution is to rewrite the JSON file as a JS file | ||
*/ | ||
const jsonFileName = process.argv[2] | ||
|
||
if (!jsonFileName) { | ||
console.error('Please provide a JSON file name as a command line argument.') | ||
process.exit(1) | ||
} | ||
|
||
try { | ||
const jsonData = fs.readFileSync(jsonFileName, 'utf8') | ||
const jsFileName = `${jsonFileName}.js` | ||
const jsContent = `module.exports = \n${jsonData}` | ||
|
||
fs.writeFileSync(jsFileName, jsContent, 'utf8') | ||
fs.rmSync(jsonFileName) | ||
|
||
console.log(`Successfully generated ${jsFileName} with JSON content.`) | ||
} catch (err) { | ||
console.error('An error occurred while generating the JavaScript file:', err) | ||
process.exit(1) | ||
} | ||
|
||
|
||
// TODO: There is additional problem where tsc does not copy .d.ts files to build, and therefore we | ||
// need to do it manully | ||
// https://stackoverflow.com/questions/56018167/typescript-does-not-copy-d-ts-files-to-build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "./dist" | ||
"outDir": "./dist", | ||
"baseUrl": "./" | ||
}, | ||
"include": ["src/*", "../util-zod/defineSdk.ts"] | ||
"include": ["./src/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"baseUrl": "./" | ||
}, | ||
"include": ["./index.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"baseUrl": "./" | ||
}, | ||
"include": ["./index.ts"] | ||
} |
e35be71
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.
Successfully deployed to the following URLs:
opensdks – ./
opensdks-venice.vercel.app
opensdks.org
opensdks.vercel.app
opensdks-git-main-venice.vercel.app