flowaccount / nx-plugins

Nx plugins built by FlowAccount team, helps deploy systems to the cloud
115 stars 34 forks source link

[BUG] Schematic "init" cannot resolve the factory. #107

Open thebrianbug opened 2 years ago

thebrianbug commented 2 years ago

Describe the bug This is a recurrence of the bug reported at https://github.com/flowaccount/nx-plugins/issues/66

To Reproduce

brianmcilwain@Brians-MacBook-Pro source % mkdir test-nx-sls && cd test-nx-sls
brianmcilwain@Brians-MacBook-Pro test-nx-sls % npx create-nx-workspace test --preset=angular --nx-cloud=false --linter=eslint --style=css --appName=testapp
npx: installed 48 in 4.089s

>  NX  Nx is creating your v13.3.6 workspace.

  To make sure the command works reliably in all environments, and that the preset is applied correctly,
  Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm
✔ Nx has successfully created the workspace.

———————————————————————————————————————————————

>  NX   NOTE  First time using Nx? Check out this interactive Nx tutorial.

  https://nx.dev/latest/angular/tutorial/01-create-application

  Prefer watching videos? Check out this free Nx course on YouTube.
  https://www.youtube.com/watch?v=2mYLe9Kp9VM&list=PLakNactNC1dH38AfqmwabvOszDmKriGco

brianmcilwain@Brians-MacBook-Pro test-nx-sls % cd test 
brianmcilwain@Brians-MacBook-Pro test % nx add @flowaccount/nx-serverless
Ng add is not natively supported by Nx
Instead, we recommend running `npm install @flowaccount/nx-serverless && npx nx g @flowaccount/nx-serverless:ng-add`
✔ Run this command? (y/N) · false
brianmcilwain@Brians-MacBook-Pro test % nx add @flowaccount/nx-serverless
Ng add is not natively supported by Nx
Instead, we recommend running `npm install @flowaccount/nx-serverless && npx nx g @flowaccount/nx-serverless:ng-add`
✔ Run this command? (y/N) · true

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated @hapi/boom@7.4.11: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hapi@18.4.1: This version contains severe security issues and defects and should not be used! Please upgrade to the latest version of @hapi/hapi or consider a commercial license (https://github.com/hapijs/hapi/issues/4114)
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@16.1.8: Switch to 'npm install joi'
npm WARN deprecated @hapi/wreck@15.1.0: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/formula@1.2.0: Moved to 'npm install @sideway/formula'
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/pinpoint@1.0.2: Moved to 'npm install @sideway/pinpoint'
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated @hapi/accept@3.2.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/catbox@10.2.3: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/call@5.1.3: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/ammo@3.1.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/shot@4.1.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bounce@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/mimos@4.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/heavy@6.2.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/catbox-memory@4.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/podium@3.4.3: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/teamwork@3.3.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/somever@2.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/statehood@6.1.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/subtext@6.1.3: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/iron@5.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/cryptiles@4.2.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/b64@4.2.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/pez@4.1.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/content@4.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/file@1.0.0: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/nigel@3.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/vise@3.1.1: This version has been deprecated and is no longer supported or maintained

> fsevents@1.2.13 install /Users/brianmcilwain/source/test-nx-sls/test/node_modules/@flowaccount/nx-serverless/node_modules/fsevents
> node install.js

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node

> fsevents@1.2.13 install /Users/brianmcilwain/source/test-nx-sls/test/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node

> snappy@6.3.5 install /Users/brianmcilwain/source/test-nx-sls/test/node_modules/snappy
> prebuild-install || node-gyp rebuild

> protobufjs@6.11.2 postinstall /Users/brianmcilwain/source/test-nx-sls/test/node_modules/protobufjs
> node scripts/postinstall

> serverless@2.69.1 postinstall /Users/brianmcilwain/source/test-nx-sls/test/node_modules/serverless
> node ./scripts/postinstall.js

   ┌───────────────────────────────────────────────────┐
   │                                                   │
   │   Serverless Framework successfully installed!    │
   │                                                   │
   │   To start your first project run “serverless”.   │
   │                                                   │
   └───────────────────────────────────────────────────┘

npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN jasmine-marbles@0.8.4 requires a peer of rxjs@^6.5.3 but none is installed. You must install peer dependencies yourself.
npm WARN rxjs-for-await@0.0.2 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @flowaccount/nx-serverless@1.0.2 requires a peer of @nrwl/workspace@^12.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-arm64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-windows-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-arm64@0.13.13: wanted {"os":"win32","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-windows-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-64@0.13.13: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-32@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-windows-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-32@0.13.13: wanted {"os":"win32","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-sunos-64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-sunos-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-sunos-64@0.13.13: wanted {"os":"sunos","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-openbsd-64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-openbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-openbsd-64@0.13.13: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-netbsd-64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-netbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-netbsd-64@0.13.13: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-ppc64le@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-linux-ppc64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-ppc64le@0.13.13: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-mips64le@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-linux-mips64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-mips64le@0.13.13: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm64@0.13.13: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm@0.13.13: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-linux-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-64@0.13.13: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-32@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-linux-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-32@0.13.13: wanted {"os":"linux","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-arm64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-freebsd-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-arm64@0.13.13: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-freebsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-64@0.13.13: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-arm64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-arm64@0.13.13: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64@0.13.13 (node_modules/jest-preset-angular/node_modules/esbuild-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64@0.13.13: wanted {"os":"android","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-arm64@0.13.12 (node_modules/esbuild-windows-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-arm64@0.13.12: wanted {"os":"win32","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-64@0.13.12 (node_modules/esbuild-windows-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-64@0.13.12: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-32@0.13.12 (node_modules/esbuild-windows-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-32@0.13.12: wanted {"os":"win32","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-sunos-64@0.13.12 (node_modules/esbuild-sunos-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-sunos-64@0.13.12: wanted {"os":"sunos","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-openbsd-64@0.13.12 (node_modules/esbuild-openbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-openbsd-64@0.13.12: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-netbsd-64@0.13.12 (node_modules/esbuild-netbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-netbsd-64@0.13.12: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-ppc64le@0.13.12 (node_modules/esbuild-linux-ppc64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-ppc64le@0.13.12: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-mips64le@0.13.12 (node_modules/esbuild-linux-mips64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-mips64le@0.13.12: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm64@0.13.12 (node_modules/esbuild-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm64@0.13.12: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm@0.13.12 (node_modules/esbuild-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm@0.13.12: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-64@0.13.12 (node_modules/esbuild-linux-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-64@0.13.12: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-32@0.13.12 (node_modules/esbuild-linux-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-32@0.13.12: wanted {"os":"linux","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-arm64@0.13.12 (node_modules/esbuild-freebsd-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-arm64@0.13.12: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-64@0.13.12 (node_modules/esbuild-freebsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-64@0.13.12: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-arm64@0.13.12 (node_modules/esbuild-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-arm64@0.13.12: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64@0.13.12 (node_modules/esbuild-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64@0.13.12: wanted {"os":"android","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})

+ @flowaccount/nx-serverless@1.0.2
added 1198 packages from 648 contributors, removed 1 package and audited 2749 packages in 63.797s

182 packages are looking for funding
  run `npm fund` for details

found 17 vulnerabilities (8 moderate, 9 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Schematic "init" cannot resolve the factory.
(node:6309) UnhandledPromiseRejectionWarning: Error: Command failed: npm install @flowaccount/nx-serverless && npx nx g @flowaccount/nx-serverless:ng-add
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at /Users/brianmcilwain/source/test-nx-sls/test/node_modules/@nrwl/cli/lib/init-local.js:72:54
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6309) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6309) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

See the bottom of the above, clipped for easy reading:

Schematic "init" cannot resolve the factory.
(node:6309) UnhandledPromiseRejectionWarning: Error: Command failed: npm install @flowaccount/nx-serverless && npx nx g @flowaccount/nx-serverless:ng-add
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at /Users/brianmcilwain/source/test-nx-sls/test/node_modules/@nrwl/cli/lib/init-local.js:72:54
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Expected behavior Should install without issues, especially for the recommended path for install

Check which provider is affected: [x] AWS [x] Azure [x] Google Cloud Platform

Check which framework is affected: [] Angular [] Nodejs [x] Serverless [] Lambda [] Infrastructure as a code

Additional context

nx report

>  NX  Report complete - copy this into the issue template

  Node : 14.16.1
  OS   : darwin x64
  npm  : 6.14.12

  nx : 13.3.6
  @nrwl/angular : 13.3.6
  @nrwl/cli : 13.3.6
  @nrwl/cypress : 13.3.6
  @nrwl/devkit : 13.3.6
  @nrwl/eslint-plugin-nx : 13.3.6
  @nrwl/express : 12.3.3
  @nrwl/jest : 13.3.6
  @nrwl/linter : 13.3.6
  @nrwl/nest : undefined
  @nrwl/next : undefined
  @nrwl/node : 12.3.3
  @nrwl/nx-cloud : undefined
  @nrwl/react : undefined
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.3.6
  @nrwl/web : undefined
  @nrwl/workspace : 13.3.6
  @nrwl/storybook : 13.3.6
  @nrwl/gatsby : undefined
  typescript : 4.4.4
  rxjs : 7.4.0
  ---------------------------------------
  Community plugins:
     @angular/animations: 13.1.1
     @angular/common: 13.1.1
     @angular/compiler: 13.1.1
     @angular/core: 13.1.1
     @angular/forms: 13.1.1
     @angular/platform-browser: 13.1.1
     @angular/platform-browser-dynamic: 13.1.1
     @angular/router: 13.1.1
     @flowaccount/nx-serverless: 1.0.2
     @angular-devkit/build-angular: 13.0.4
     @angular/cli: 13.0.4
     @angular/compiler-cli: 13.1.1
     @angular/language-service: 13.1.1
thebrianbug commented 2 years ago

Until I get past this Schematic "init" cannot resolve the factory. bug, I can't successfully install this package to give it a try 🤷

Advice appreciated. I don't want to maintain a fork of serverless-plugin-optimize indefinitely

thebrianbug commented 2 years ago

I also attempted this in my main project repo (the one I am currently deploying with a fork of serverless-plugin-optimize). I got the same error

$ npm install @flowaccount/nx-serverless && npx nx g @flowaccount/nx-serverless:ng-add

...

# (npm install warnings, but it does install successfully)

Schematic "init" cannot resolve the factory.
wickstargazer commented 2 years ago

@bmcilw1 npx nx g @flowaccount/nx-serverless:ng-add used to support adding to angular unviersal.

I would recommend not to use it, I will find a way to bring it back for api-serverless mean while can you do yarn nx g @flowaccount/nx-serverless:api-serverless and let me know if it works?

it works here on my side but only before nx-13 which i tried to migrate but got stuck at webpack-5 version of types and how its being used in the package service.