Skip to content

Commit

Permalink
fix generate
Browse files Browse the repository at this point in the history
  • Loading branch information
ericanderson committed Aug 12, 2024
1 parent 579b4a4 commit acb7ee3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ NOTE: DO NOT EDIT THIS README BY HAND. It is generated by monorepolint.
includePackages: ["@osdk/e2e.test.foundry-sdk-generator"],
}, {
legacy: false,
esmOnly: true,
tsVersion: LATEST_TYPESCRIPT_DEP,
customTsconfigExcludes: [
"./src/generatedNoCheck/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ async function setup() {
await safeStat(testAppDir, "should not exist");
await safeStat(testApp2Dir, "should not exist");

await fs.mkdir(dir, { recursive: true });

const generatePackageCommand = new GeneratePackageCommand();
await generatePackageCommand.handler({
packageName: "@test-app/osdk",
Expand Down
8 changes: 3 additions & 5 deletions packages/e2e.test.foundry-sdk-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@
},
"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-attw": "monorepo.tool.attw esm",
"check-spelling": "cspell --quiet .",
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
"codegen": "node ./generateMockOntology.js",
"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"
"typecheck": "monorepo.tool.typecheck esm"
},
"dependencies": {
"@osdk/foundry-sdk-generator": "workspace:~",
Expand Down Expand Up @@ -56,6 +54,6 @@
],
"main": "./build/cjs/index.cjs",
"module": "./build/esm/index.js",
"types": "./build/cjs/index.d.cts",
"types": "./build/esm/index.d.ts",
"type": "module"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
* limitations under the License.
*/

import { __testSeamOnly_NotSemverStable__GeneratePackageCommand as GeneratePackageCommand } from "@osdk/foundry-sdk-generator";
import { existsSync } from "node:fs";
import * as fs from "node:fs/promises";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";

describe(GeneratePackageCommand, () => {
describe("Generate Package Command", () => {
// ensure that we do not break backcompat by retaining our scripts export that links to the bundled types and esm output
it("has a public scripts export", async () => {
const generatedPath = path.join(
Expand Down
4 changes: 3 additions & 1 deletion packages/e2e.test.foundry-sdk-generator/tsup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@
import { defineConfig } from "tsup";

export default defineConfig(async (options) =>
(await import("@osdk/monorepo.tsup")).default(options, {})
(await import("@osdk/monorepo.tsup")).default(options, {
esmOnly: true,
})
);
1 change: 1 addition & 0 deletions packages/monorepo.tsup/tsup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default async (options, ourOptions) => {
silent: true,
sourcemap: true,
splitting: true,
shims: true, // so we can use __dirname in both esm and cjs
minify: false, // !options.watch,
onSuccess: async () => {
console.log("👍");
Expand Down

0 comments on commit acb7ee3

Please sign in to comment.