-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Covert to V2 addon (a real npm package!) #345
base: master
Are you sure you want to change the base?
Conversation
.github/workflows/ci-build.yml
Outdated
jobs: | ||
test: | ||
name: Tests | ||
name: "Tests" | ||
runs-on: ubuntu-latest | ||
|
||
steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we lose testing against multiple node versions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically an original file!
) => initialChar + (chr ? chr.toUpperCase() : ''); | ||
const parts = str.split('/'); | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.replace(STRING_CLASSIFY_REGEXP_1, replace1) | ||
.replace(STRING_CLASSIFY_REGEXP_2, replace2); | ||
} | ||
|
||
return parts | ||
.join('/') | ||
.replace(STRING_CLASSIFY_REGEXP_3, (match /*, separator, chr */) => | ||
match.toUpperCase() | ||
match.toUpperCase(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newer prettier version wanted commas 🤷
"compilerOptions": { | ||
"allowJs": true, | ||
"declarationDir": "declarations", | ||
"noEmit": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Changelog notes
(otherwise there is nothing changed about how
@ember/string
works 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 --typescript
There is some divergence, however (
@ember/string
is 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__string
from 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
test
command 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 test
command do too much. Now test just means test.tsconfig.json
has 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/ember
is 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/string
is 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/string
has no ember api usagekeywords: [ember-addon]
, remove package.json#ember-addon, etc@ember/string
is, 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