Covert to V2 addon (a real npm package!)#345
Covert to V2 addon (a real npm package!)#345NullVoxPopuli wants to merge 4 commits intoemberjs:masterfrom
Conversation
.github/workflows/ci-build.yml
Outdated
| name: "Tests" | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: |
There was a problem hiding this comment.
Did we lose testing against multiple node versions here?
There was a problem hiding this comment.
I forgot to answer this!
There is no need, because the output of this repo is browser-code, so node isn't relevant.
|
Gonna pull some smaller PRs out of this, since folks are interested in I also want to use this as an opportunity to see how v2 addon conversions work. (if a maintainer wants to convert this PR back to "Draft", that'd be appreciated <3 ) The order will be (and I'll link to these PRs as they're created):
As this happens, the "diff" of this PR will get much smaller (even though most of it is lockfile, and js->ts conversions). |
There was a problem hiding this comment.
basically an original file!
|
|
||
| for (let i = 0; i < parts.length; i++) { | ||
| parts[i] = parts[i] | ||
| parts[i] = (parts as any)[i] |
There was a problem hiding this comment.
added because TS has gotten stricter since this PR was initially opened and TS now considers this dangerous -- it would be great though if it could determine that i was bounded to the range within parts
| .join('/') | ||
| .replace(STRING_CLASSIFY_REGEXP_3, (match /*, separator, chr */) => | ||
| match.toUpperCase() | ||
| match.toUpperCase(), |
There was a problem hiding this comment.
newer prettier version wanted commas 🤷
| "compilerOptions": { | ||
| "allowJs": true, | ||
| "declarationDir": "declarations", | ||
| "noEmit": false, |
There was a problem hiding this comment.
these 3 settings here were required to generate declarations with tsc --declaration.
I need to look in to if it makes sense to put these in the addon-blueprint, or if we should just "fork" @tsconfig/ember at this point (still in tsconfig/bases tho) maybe with a v2 app the delta can start shrinking again
Add LTS 5.4 Run ember init to sync with blueprint Lint:fix Lint:fix Fix package.json Fix types build tsc args! Can we have the same compatibility as before? Re-add the tests workspace The test-app does not need to lint in order to test Try to re-gain ember 3.20+ compat Drop support for ember < 3.28 delete more glint stuff
|
This is no longer relevant, correct? |
|
correct, we already did this |
Changelog notes
(otherwise there is nothing changed about how
@ember/stringworks and the two files involved (index.ts and cache.ts) show up as moves)Changes
Much of this was done via
ember init -b @embroider/blueprint --pnpm --typescriptThere is some divergence, however (
@ember/stringis maybe not the best example of a use case for the v2 addon blueprint):ci.yml / ember-try support is expanded back to ember 3.20
I removed
@types/ember__stringfrom the test-app, because we build the types hereI removed glint because this package does not need that tool, and tsc is sufficient
I removed linting from the
testcommand in the test-app. it's silly as we have a separate lint command in CI having lint in the test command made the top-levelpnpm testcommand do too much. Now test just means test.tsconfig.jsonhas additional settings set because declaration emit is kind of wonkey and we may want to consider adding a separate@tsconfig/ember(maybe@tsconfig/esm-library?) because@tsconfig/emberis currently splitting duty between libraries and apps, and trying to make both happy, even though apps are non-spec compliant, for the most part)vitest for tests (in addition to the test-app (this was done in the original pass at conversion back in 2022))
@ember/stringis legit nothing special and requires no ember APIs. For folks working in this repo, this means they'll have instant test feedback and better editor integration when working in testsThings we could do since
@ember/stringhas no ember api usagekeywords: [ember-addon], remove package.json#ember-addon, etc@ember/stringis, the v2 addon format is more boilerplate plate than we need and sets us back a bit from where we could be (still ahead of a v1 addon though!)Unrelated changes