Skip to content

Commit

Permalink
Actually fix script for foundry-sdk-generator (#499)
Browse files Browse the repository at this point in the history
* Actually fix script for foundry-sdk-generator

* Fix ci

* increase test timeout
  • Loading branch information
ericanderson authored Jul 19, 2024
1 parent 029d816 commit 6bf66d5
Show file tree
Hide file tree
Showing 15 changed files with 6,667 additions and 5,186 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-apples-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/foundry-sdk-generator": patch
---

Actually fix the script to run
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
fetch-depth: 0

- uses: pnpm/action-setup@v4
with:
version: 8.7.4

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand All @@ -51,8 +49,6 @@ jobs:
fetch-depth: 0

- uses: pnpm/action-setup@v4
with:
version: 8.7.4

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand Down Expand Up @@ -89,8 +85,6 @@ jobs:
fetch-depth: 2

- uses: pnpm/action-setup@v4
with:
version: 8.7.4

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:

- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 8.7.4

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
18.20.4
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
18.20.4
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
}
},
"engines": {
"node": ">=16",
"pnpm": ">=8.7.4"
"node": ">=18.19.0",
"pnpm": "=9.5.0"
},
"packageManager": "pnpm@8.7.4"
"packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
}
58 changes: 58 additions & 0 deletions packages/e2e.test.foundry-sdk-generator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@osdk/e2e.test.foundry-sdk-generator",
"private": true,
"version": "0.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"require": "./build/cjs/index.cjs",
"browser": "./build/browser/index.js",
"import": "./build/esm/index.js"
},
"./*": {
"require": "./build/cjs/public/*.cjs",
"browser": "./build/browser/public/*.js",
"import": "./build/esm/public/*.js"
}
},
"scripts": {
"check-attw": "monorepo.tool.attw both",
"check-spelling": "cspell --quiet .",
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
"test": "vitest run --pool=forks",
"transpile": "monorepo.tool.transpile",
"typecheck": "monorepo.tool.typecheck both"
},
"dependencies": {
"@osdk/foundry-sdk-generator": "workspace:~",
"execa": "^9.3.0"
},
"devDependencies": {
"@osdk/monorepo.api-extractor": "workspace:~",
"@osdk/monorepo.tsconfig": "workspace:~",
"@osdk/monorepo.tsup": "workspace:~",
"typescript": "^5.5.2"
},
"publishConfig": {
"access": "public"
},
"files": [
"build/cjs",
"build/esm",
"build/browser",
"CHANGELOG.md",
"package.json",
"templates",
"*.d.ts"
],
"main": "./build/cjs/index.cjs",
"module": "./build/esm/index.js",
"types": "./build/cjs/index.d.cts",
"type": "module"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
*
* 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 { execa } from "execa";
import { describe, expect, it } from "vitest";

describe("foundry-sdk-generator", () => {
it("should do a basic execution", async () => {
expect(true).toBe(true);

const { stdout } = await execa`pnpm exec foundry-sdk-generator --help`;

expect(stdout).toMatchInlineSnapshot(`
"foundry-sdk-generator.cjs <command>
Commands:
foundry-sdk-generator.cjs Generates a new npm package which
generatePackage can be published
Options:
--help Show help [boolean]
--version Show version number [boolean]"
`);
});
}, { timeout: 10_000 });
//
17 changes: 17 additions & 0 deletions packages/e2e.test.foundry-sdk-generator/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
*
* 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.
*/

export {};
14 changes: 14 additions & 0 deletions packages/e2e.test.foundry-sdk-generator/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "Node",
"target": "ES6",
"rootDir": "src",
"outDir": "build/cjs"
},
"include": [
"./src/**/*"
],
"references": []
}
11 changes: 11 additions & 0 deletions packages/e2e.test.foundry-sdk-generator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@osdk/monorepo.tsconfig/base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm"
},
"include": [
"./src/**/*"
],
"references": []
}
21 changes: 21 additions & 0 deletions packages/e2e.test.foundry-sdk-generator/tsup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
*
* 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 { defineConfig } from "tsup";

export default defineConfig(async (options) =>
(await import("@osdk/monorepo.tsup")).default(options, {})
);
8 changes: 8 additions & 0 deletions packages/e2e.test.foundry-sdk-generator/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["//"],
"tasks": {
"test": {
"dependsOn": ["@osdk/foundry-sdk-generator#transpile"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
* limitations under the License.
*/

const cli = require("../build/js/index.cjs");
const cli = require("../build/cjs/index.cjs");
cli.cli();
Loading

0 comments on commit 6bf66d5

Please sign in to comment.