Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix build step #471

Closed
wants to merge 3 commits into from
Closed

Conversation

akre54
Copy link
Contributor

@akre54 akre54 commented Dec 7, 2023

Attempt to fix the yarn cli build step - see #470.

It also moves the rollup.config.js file to rollup.config.mjs because rollup was complaining about import in a .js file.

This fixes the first few issues around typescript errors with esbuild, but there is still an issue when running build:ts:bundle from the root directory:

theatre 470-fix-build ✗ yarn build:ts:bundle

~/Projects/theatre/theatre/.temp/declarations/studio/src/index.d.ts → studio/dist...
[!] (plugin rpt2) RollupError: Expected ',', got '{' (Note that you need plugins to import files that are not JavaScript)
.temp/declarations/studio/src/index.d.ts (6:12)
4:  * @packageDocumentation
5:  */
6: import type { IStudio } from '@theatre/studio/TheatreStudio';
               ^
7: /**
8:  * The main instance of Studio. Read more at {@link IStudio}
RollupError: Expected ',', got '{'
    at error (~/Projects/theatre/node_modules/rollup/dist/shared/parseAst.js:279:30)
    at nodeConverters (~/Projects/theatre/node_modules/rollup/dist/shared/parseAst.js:2147:9)
    at convertNode (~/Projects/theatre/node_modules/rollup/dist/shared/parseAst.js:1032:12)
    at convertProgram (~/Projects/theatre/node_modules/rollup/dist/shared/parseAst.js:1023:48)
    at Object.parseAstAsync (~/Projects/theatre/node_modules/rollup/dist/shared/parseAst.js:2213:20)
    at Module.tryParseAsync (~/Projects/theatre/node_modules/rollup/dist/shared/rollup.js:14921:21)
    at Module.setSource (~/Projects/theatre/node_modules/rollup/dist/shared/rollup.js:14502:35)
    at ModuleLoader.addModuleSource (~/Projects/theatre/node_modules/rollup/dist/shared/rollup.js:18796:13)

Copy link

vercel bot commented Dec 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
theatre-playground ❌ Failed (Inspect) Dec 7, 2023 7:34pm

@akre54
Copy link
Contributor Author

akre54 commented Dec 7, 2023

Using rollup-plugin-dts (not the flat version) gives this error:

theatre 470-fix-build ✗ yarn build:ts:bundle

~/Projects/theatre/theatre/.temp/declarations/studio/src/index.d.ts → studio/dist...
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
@theatre/utils/types (imported by ".temp/declarations/studio/src/TheatreStudio.d.ts", ".temp/declarations/studio/src/PaneManager.d.ts", ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts" and ".temp/declarations/core/src/privateAPIs.d.ts")
@theatre/sync-server/state/types (imported by ".temp/declarations/studio/src/TheatreStudio.d.ts", ".temp/declarations/studio/src/PaneManager.d.ts" and ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts")
@theatre/sync-server/state/types/studio (imported by ".temp/declarations/studio/src/Studio.d.ts")
@theatre/sync-server/state/types/core (imported by ".temp/declarations/studio/src/Studio.d.ts" and ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts")
@theatre/sync-server/state/schema (imported by ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts")
@theatre/sync-server/trpc/routes (imported by ".temp/declarations/studio/src/SyncStore/SyncServerLink.d.ts")
[!] (plugin dts) Error: namespace child (hoisting) not supported yet

  389 |
  390 | declare namespace Prisma {
> 391 |   export import DMMF = runtime.DMMF
      |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  392 |
  393 |   export type PrismaPromise<T> = runtime.Types.Public.PrismaPromise<T>
  394 |
../packages/app/prisma/client-generated/index.d.ts

@akre54
Copy link
Contributor Author

akre54 commented Dec 7, 2023

Confirmed that, using the original rollup-plugin-dts but changing the respectExternal from true to the default false removes the error, but also gives a long list of unresolved dependencies:

(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
@theatre/utils/types (imported by ".temp/declarations/studio/src/TheatreStudio.d.ts", ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts", ".temp/declarations/core/src/privateAPIs.d.ts", ".temp/declarations/studio/src/PaneManager.d.ts" and ".temp/declarations/core/src/propTypes/index.d.ts")
@theatre/sync-server/state/types (imported by ".temp/declarations/studio/src/TheatreStudio.d.ts", ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts" and ".temp/declarations/studio/src/PaneManager.d.ts")
@theatre/sync-server/state/types/studio (imported by ".temp/declarations/studio/src/Studio.d.ts")
@theatre/sync-server/state/types/core (imported by ".temp/declarations/studio/src/Studio.d.ts" and ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts")
@theatre/sync-server/state/schema (imported by ".temp/declarations/studio/src/StudioStore/StudioStore.d.ts")
@theatre/sync-server/trpc/routes (imported by ".temp/declarations/studio/src/SyncStore/SyncServerLink.d.ts")
@theatre/utils/color (imported by ".temp/declarations/core/src/propTypes/index.d.ts")

@AriaMinaei
Copy link
Member

Ah sorry for responding late. So we moved things around a bit (moved everything in theatre/* to separate packages in packages/*, among other things). Build is fixed as of 42483a2.

@AriaMinaei AriaMinaei closed this Jan 4, 2024
@akre54
Copy link
Contributor Author

akre54 commented Jan 4, 2024

Thanks @AriaMinaei, looking forward to trying this out.

Any news on a new version release? Appreciate all the hard work

@akre54 akre54 deleted the 470-fix-build branch January 4, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants