NullVoxPopuli / ember-yarn-2

Let's see what it takes to get Ember working with yarn 2 (the yarn that's actually developed)
1 stars 0 forks source link

Migration Path #1

Open NullVoxPopuli opened 4 years ago

NullVoxPopuli commented 4 years ago

Following this guide https://yarnpkg.com/advanced/migration#run-the-doctor

Versions and System Info ``` $ yarn --version 2.2.2 $ volta install ember-cli Package ember-cli@3.21.0 is already installed $ ember --version Volta error: Could not locate executable `ember` in your project. Please ensure that all project dependencies are installed with `npm install` or `yarn install` $ node --version v12.18.3 $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal ```

Issue: https://github.com/volta-cli/volta/issues/812

Related Issue: https://github.com/volta-cli/volta/issues/651

Step 1: @yarnpkg/doctor

`npx @yarnpkg/doctor` output ``` $ npx @yarnpkg/doctor npx: installed 177 in 19.123s ➤ YN0000: Found 1 package(s) to process ➤ YN0000: For a grand total of 7 file(s) to validate ➤ YN0000: ┌ /NullVoxPopuli/ember-yarn-2/package.json ➤ YN0000: │ /NullVoxPopuli/ember-yarn-2/app/app.js:1:1: Undeclared dependency on @ember/application ➤ YN0000: │ /NullVoxPopuli/ember-yarn-2/app/router.js:1:1: Undeclared dependency on @ember/routing ➤ YN0000: │ /NullVoxPopuli/ember-yarn-2/tests/test-helper.js:3:1: Undeclared dependency on @ember/test-helpers ➤ YN0000: └ Completed in 3.27s ➤ YN0000: Failed with errors in 3.27s ```

This'll likely be a common problem for all of ember's packages until ember is finally split into real modules ignoring for now, because these package paths are transformed by ember-cli-babel

Initial .yarnrc.yml ```yml enableGlobalCache: true plugins: - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs spec: "@yarnpkg/plugin-interactive-tools" yarnPath: .yarn/releases/yarn-berry.cjs packageExtensions: "ember-source@*": dependencies: "@babel/core": "*" ```

Step 2: yarn && yarn start

and running yarn start results in: Missing template processor

Log file ``` ================================================================================= ENV Summary: TIME: Sun Sep 06 2020 07:34:02 GMT-0400 (Eastern Daylight Time) TITLE: ember ARGV: - /home/me/.volta/tools/image/node/12.18.3/bin/node - /home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/bin/ember - serve EXEC_PATH: /home/me/.volta/tools/image/node/12.18.3/bin/node TMPDIR: /tmp SHELL: /bin/bash PATH: - /tmp/xfs-424fa0c0 - /home/me/.volta/tools/image/yarn/1.22.5/bin - /home/me/.volta/tools/image/node/12.18.3/bin - /home/me/.pythons/Python-3.6.3/bin - /home/me/.cargo/bin - /home/me/Applications - /home/me/apps/phantomjs/bin - /home/me/scripts/system-utils - /home/me/scripts/git - /home/me/scripts/rails - /home/me/scripts - /usr/local/sbin - /usr/local/bin - /usr/sbin - /usr/bin - /sbin - /bin - /usr/games - /usr/local/games - /snap/bin - /home/me/.dotnet/tools - /home/me/.dotnet/tools - /home/me/.fzf/bin PLATFORM: linux x64 FREEMEM: 13833887744 TOTALMEM: 17388265472 UPTIME: 220 LOADAVG: 0.07666015625,0.11962890625,0.05322265625 CPUS: - Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz - 3192 - Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz - 3192 - Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz - 3192 - Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz - 3192 - Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz - 3192 - Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz - 3192 ENDIANNESS: LE VERSIONS: - ares: 1.16.0 - brotli: 1.0.7 - cldr: 37.0 - http_parser: 2.9.3 - icu: 67.1 - llhttp: 2.0.4 - modules: 72 - napi: 6 - nghttp2: 1.41.0 - node: 12.18.3 - openssl: 1.1.1g - pnp: 3 - tz: 2019c - unicode: 13.0 - uv: 1.38.0 - v8: 7.8.279.23-node.39 - zlib: 1.2.11 ERROR Summary: - broccoliBuilderErrorStack: [undefined] - code: [undefined] - codeFrame: [undefined] - errorMessage: Missing template processor - errorType: [undefined] - location: - column: [undefined] - file: [undefined] - line: [undefined] - message: Missing template processor - name: Error - nodeAnnotation: [undefined] - nodeName: [undefined] - originalErrorMessage: [undefined] - stack: Error: Missing template processor at module.exports.preprocessTemplates (/home/me/.yarn/berry/cache/ember-cli-preprocess-registry-npm-3.3.0-a6fe60c13a-6.zip/node_modules/ember-cli-preprocess-registry/preprocessors.js:166:11) at DefaultPackager.processTemplates (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/broccoli/default-packager.js:444:9) at DefaultPackager.processAppAndDependencies (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/broccoli/default-packager.js:225:14) at DefaultPackager.packageJavascript (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/broccoli/default-packager.js:1176:32) at EmberApp._legacyPackage (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/broccoli/ember-app.js:1617:48) at EmberApp.toTree (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/broccoli/ember-app.js:1663:27) at module.exports (/home/me/Development/NullVoxPopuli/ember-yarn-2/ember-cli-build.js:23:14) at Builder.readBuildFile (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/models/builder.js:49:14) at Builder.setupBroccoliBuilder (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/models/builder.js:63:22) at new Builder (/home/me/.yarn/berry/cache/ember-cli-npm-3.21.0-a01eaa3a9d-6.zip/node_modules/ember-cli/lib/models/builder.js:29:10) ================================================================================= ```

Issue: https://github.com/ember-cli/ember-cli/issues/9322

Error thrown from: https://github.com/ember-cli/ember-cli-preprocess-registry/blob/v3.3.0/preprocessors.js#L166

Step 3: Resolving yarn's resolution warnings

This doesn't need to come after step 2, but I need a visual separation between this section and the issue above

yarn's resolution step & complaints ``` $ yarn ➤ YN0000: ┌ Resolution step ➤ YN0002: │ ember-cli-typescript@npm:3.0.0 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-transform-typescript@npm:7.5.5 ➤ YN0002: │ ember-compatibility-helpers@npm:1.2.1 doesn't provide @babel/core@^7.0.0-beta.42 requested by babel-plugin-debug-macros@npm:0.2.0 ➤ YN0002: │ ember-cli-babel@npm:6.18.0 doesn't provide @babel/core@^7.0.0-beta.42 requested by babel-plugin-debug-macros@npm:0.2.0 ➤ YN0002: │ ember-cli-typescript@npm:3.1.4 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-proposal-nullish-coalescing-operator@npm:7.10.4 ➤ YN0002: │ ember-cli-typescript@npm:3.1.4 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-proposal-optional-chaining@npm:7.11.0 ➤ YN0002: │ ember-cli-typescript@npm:3.1.4 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-transform-typescript@npm:7.8.7 ➤ YN0002: │ @ember-data/private-build-infra@npm:3.21.0 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-transform-block-scoping@npm:7.11.1 ➤ YN0002: │ @ember-data/private-build-infra@npm:3.21.0 doesn't provide @babel/core@^7.0.0 requested by babel-plugin-debug-macros@npm:0.3.3 ➤ YN0002: │ ember-cli-typescript@npm:2.0.2 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-proposal-class-properties@npm:7.10.4 ➤ YN0002: │ ember-cli-typescript@npm:2.0.2 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-transform-typescript@npm:7.4.5 ➤ YN0002: │ ember-resolver@npm:8.0.2 doesn't provide @babel/core@^7.0.0 requested by babel-plugin-debug-macros@npm:0.3.3 ➤ YN0002: │ ember-yarn-2@workspace:. doesn't provide @babel/core@* requested by ember-source@npm:3.21.1 ```
.yarnrc.yml that resolves all of the above issues ``` enableGlobalCache: true plugins: - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs spec: "@yarnpkg/plugin-interactive-tools" yarnPath: .yarn/releases/yarn-berry.cjs packageExtensions: "ember-source@*": dependencies: "@babel/core": "*" "ember-cli-typescript@*": dependencies: "@babel/core": "*" "ember-cli-babel@*": dependencies: "@babel/core": "*" "@ember-data/private-build-infra@*": dependencies: "@babel/core": "*" "ember-resolver@*": dependencies: "@babel/core": "*" "ember-compatibility-helpers@*": dependencies: "@babel/core": "*" ```

NOTE: the issues reported by @yarnpkg/doctor are not resolved via packageExtensions

acorncom commented 4 years ago

Not sure if you’ve seen https://github.com/ember-cli/ember-cli/issues/8164 but it might help as well?