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

feature/issue 32 migrate to greenwood #44

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

thescientist13
Copy link
Contributor

@thescientist13 thescientist13 commented Nov 25, 2023

resolves #32

Screen Shot 2023-11-24 at 9 16 27 PM

Changes

  1. Migrated all API endpoints from Architect to Greenwood
  2. Created local development dashboard
  3. Upgrade to ESLint 9

TODO

  1. can't bundle now?
          Error: Could not load /Users/owenbuckley/Workspace/analogstudiosri/api/src/: EISDIR: illegal operation on a directory, read
           at async readFileHandle (node:internal/fs/promises:553:24)
           at async NodeModulesResource.serve (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/plugins/resource/plugin-node-modules.js:49:18)
           at async Object.load (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/config/rollup.config.js:81:24)
           at async PluginDriver.hookFirstAndGetPlugin (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/rollup/dist/es/shared/node-entry.js:20712:28)
           at async file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/rollup/dist/es/shared/node-entry.js:19832:33
           at async Queue.work (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/rollup/dist/es/shared/node-entry.js:20922:32) {
         errno: -21,
         code: 'PLUGIN_ERROR',
         syscall: 'read',
         pluginCode: 'EISDIR',
         plugin: 'commonjs--resolver',
         hook: 'resolveId',
         id: '/Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/qs/lib/index.js'
       
  2. Fix Contentful / Events serve build error
    Screenshot 2024-12-06 at 2 24 26 PM
         Started server at http://localhost:8080
         TypeError: callBind is not a function
             at requireCallBound (file:///Users/owenbuckley/Workspace/analogstudiosri/api/public/api/events.js:9431:17)
             at requireSideChannel (file:///Users/owenbuckley/Workspace/analogstudiosri/api/public/api/events.js:10011:18)
             at requireStringify$1 (file:///Users/owenbuckley/Workspace/analogstudiosri/api/public/api/events.js:10454:23)
             at requireLib (file:///Users/owenbuckley/Workspace/analogstudiosri/api/public/api/events.js:11123:32)
             at file:///Users/owenbuckley/Workspace/analogstudiosri/api/public/api/events.js:11135:32
             at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
             at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
             at async file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lifecycles/serve.js:404:31
             at async file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lifecycles/serve.js:311:7
             at async file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lifecycles/serve.js:269:5
       
  3. How to handle environment variables / file in CI
  4. resolve upstreams / pull in latest version of Greenwood
  5. validate contentful webhook
  6. validate Prisma studio
  7. adopt TypeScript
  8. Prototype an AWS Adapter (SST?) - AWS Adapter plugin ProjectEvergreen/greenwood#1142
    • stage
    • prod
    • externalize the AWS SDK?
  9. Setup environment variables (Node 20? - https://nodejs.org/en/blog/release/v20.6.0)
  10. Update README
    • proper local vs prod workflow (local SQL?)
    • Prisma studio

Upstreams

  1. package.json exports handling for nested default (current solution is super slow though 😬) - improve support for package.json exports when building up import maps ProjectEvergreen/greenwood#1317
  2. @libsql/client and @aws-sdk/client-cloudfront is super slow building up an import map now 😳? Are we double walking maybe? 🤔 - enhancement/issue 684 import map generation cache and dedupe optimizations ProjectEvergreen/greenwood#1377
    • found a massive performance boost to help with circular deps and repetitive / duped deps 💯
  3. why are we getting a resolveId for ./ in Rollup? - rollup bundling failing trying to resolve directories ProjectEvergreen/greenwood#1385
          Error: Could not load /Users/owenbuckley/Workspace/analogstudiosri/api/src/: EISDIR: illegal operation on a directory, read
           at async readFileHandle (node:internal/fs/promises:553:24)
           at async NodeModulesResource.serve (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/plugins/resource/plugin-node-modules.js:49:18)
           at async Object.load (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/config/rollup.config.js:81:24)
           at async PluginDriver.hookFirstAndGetPlugin (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/rollup/dist/es/shared/node-entry.js:20712:28)
           at async file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/rollup/dist/es/shared/node-entry.js:19832:33
           at async Queue.work (file:///Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/rollup/dist/es/shared/node-entry.js:20922:32) {
         errno: -21,
         code: 'PLUGIN_ERROR',
         syscall: 'read',
         pluginCode: 'EISDIR',
         plugin: 'commonjs--resolver',
         hook: 'resolveId',
         id: '/Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/qs/lib/index.js'
       
  4. No supported entry point for tslib - import map generation not finding package.json for some libraries like tslib (when recursively segmenting entry point) ProjectEvergreen/greenwood#1386
    • WARNING: No supported entry point detected for => 'tslib'
  5. ERROR (ERR_MODULE_NOT_FOUND) with import.meta.resolve for type-fest - https://github.com/ProjectEvergreen/www.greenwoodjs.dev/pull/153/files#r1919461371
       ERROR (ERR_MODULE_NOT_FOUND): unable to resolve specifier => `type-fest` 
       Cannot find package 'type-fest' imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js
       
  6. transitive contentful dependency process is being resolved to the built-in NodeJS process, which of course won't have a package.json - enhancement/issue 684 improve import map generation diagnostics ProjectEvergreen/greenwood#1389
    • this is expected bevahior
         --------------------------------------
         resolve >>> { dependency: 'process', resolved: 'node:process' }
         derivePackageRoot { resolved: 'node:process', root: '' }
         --------------------------------------
       
  7. some packages are returning ERR_PACKAGE_PATH_NOT_EXPORTED with import.meta.resolve ( @libsql/core, @types/ws, dunder-proto, math-intrinsics) - enhancement/issue 684 improve import map generation diagnostics ProjectEvergreen/greenwood#1389
         ****************************************************************************
         ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => `@libsql/core` 
         No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@libsql/core/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js
         ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => `@types/ws` 
         No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@types/ws/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js
         ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => `dunder-proto` 
         No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/dunder-proto/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js
         ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => `math-intrinsics` 
         No "exports" main defined in /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/math-intrinsics/package.json imported from /Users/owenbuckley/Workspace/analogstudiosri/api/node_modules/@greenwood/cli/src/lib/walker-package-ranger.js
       
  8. Rollup bundling failing - bug/1385 better sanitize Rollup importer for when resolving user workspace resources ProjectEvergreen/greenwood#1388

As a follow up effort, might be cool to turn that simple dashboard into a local first admin UI for updating content too? 🤩

@thescientist13 thescientist13 added feature New feature or request needs upstream labels Nov 25, 2023
@thescientist13 thescientist13 self-assigned this Nov 25, 2023
@thescientist13 thescientist13 force-pushed the feature/issue-32-migrate-to-greenwood branch from 5c4c2c2 to 8d2f0c4 Compare December 11, 2023 21:55
@thescientist13 thescientist13 changed the title Feature/issue 32 migrate to greenwood feature/issue 32 migrate to greenwood Feb 3, 2024
@thescientist13 thescientist13 force-pushed the feature/issue-32-migrate-to-greenwood branch from 8d2f0c4 to 3e39af8 Compare December 6, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request needs upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to Greenwood + AWS Adapter
1 participant