Skip to content

Commit

Permalink
fix: better package names (#2169)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitksingh1490 authored Jun 11, 2024
1 parent 864e56a commit 30927d2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
57 changes: 52 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -501,21 +501,68 @@ jobs:
run: |
cd npm
npm install
- name: Setup .npmrc file to publish to npm
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > ~/.npmrc
- name: Run generate-root.js script
env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
run: |
cd npm
npm run gen-root -- --version ${{ env.APP_VERSION }}
- name: Setup .npmrc file to publish to npm
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > ~/.npmrc
- name: Publish packages
npm run gen-root -- --version ${{ env.APP_VERSION }} --name @tailcallhq/tailcall
- name: Publish package Tailcall
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: npm/@tailcallhq/tailcall
access: public

- name: Run generate-root.js script
env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
run: |
cd npm
npm run gen-root -- --version ${{ env.APP_VERSION }} --name graphql-runtime
- name: Publish package graphql-runtime
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: npm/graphql-runtime
access: public
- name: Run generate-root.js script
env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
run: |
cd npm
npm run gen-root -- --version ${{ env.APP_VERSION }} --name graphql-core
- name: Publish package graphql-core
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: npm/graphql-core
access: public
- name: Run generate-root.js script
env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
run: |
cd npm
npm run gen-root -- --version ${{ env.APP_VERSION }} --name @tailcallhq/graphql
- name: Publish package @tailcallhq/graphql
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: npm/@tailcallhq/graphql
access: public
- name: Run generate-root.js script
env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
run: |
cd npm
npm run gen-root -- --version ${{ env.APP_VERSION }} --name graphql-runkit
- name: Publish package graphql-runkit
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: npm/graphql-runkit
access: public
env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion npm/gen-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const __dirname = dirname(fileURLToPath(import.meta.url))

interface ICLI {
version: string
name: string
}

const options = parse<ICLI>({
version: {alias: "v", type: String},
name: {alias: "n", type: String},
})

async function getBuildDefinitions(): Promise<string[]> {
Expand All @@ -23,6 +25,7 @@ async function getBuildDefinitions(): Promise<string[]> {

async function genServerPackage(buildDefinitions: string[]) {
const packageVersion = options.version || "0.1.0"
const name = options.name || "@tailcallhq/tailcall"

console.log(`Generating package.json with version ${packageVersion}`)

Expand All @@ -43,7 +46,7 @@ async function genServerPackage(buildDefinitions: string[]) {
repository: repository!,
homepage: homepage!,
keywords: keywords!,
name: "@tailcallhq/tailcall",
name: name,
type: "module",
version: packageVersion,
optionalDependencies,
Expand Down
1 change: 1 addition & 0 deletions src/core/blueprint/blueprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub enum Definition {
Union(UnionTypeDefinition),
}
impl Definition {
/// gets the name of the definition
pub fn name(&self) -> &str {
match self {
Definition::Interface(def) => &def.name,
Expand Down

1 comment on commit 30927d2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 6.67ms 3.49ms 206.25ms 78.28%
Req/Sec 3.81k 205.49 4.55k 93.83%

454963 requests in 30.01s, 2.28GB read

Requests/sec: 15162.79

Transfer/sec: 77.83MB

Please sign in to comment.