Commit Graph
11 Commits
Author SHA1 Message Date
Emma Segal-Grossman 1feee354c7 Configure package exports explicitly (#336)
Closes #337
Blocks https://github.com/webrecorder/archiveweb.page/issues/198

Adds a dedicated `misc` export, as well as explicitly exporting the
`electron-*` files and the `index.html` file. This restricts imports to
only these files, and allows us to not have to exactly match webpack
configs between RWP and AWP.
2024-06-18 21:41:21 -04:00
Emma Segal-Grossman 5c7b914e69 Typescript config parity with Browsertrix repo (#289)
Follow-up from #288 

This matches the strictness rules with the Browsertrix repo,
specifically `noImplicitAny`, and then adds `// @ts-expect-error`s to
suppress existing errors this change raises. This'll help us keep code
quality high moving forward.

Going to just directly merge this once it passes CI; as with #288, this
doesn't change any code, just comments.
2024-03-07 21:12:26 -05:00
Emma Segal-Grossman 40d84f3383 ESLint parity with the Browsertrix repo (#288)
This copies the rules from the Browsertrix repo, and uses
[`suppress-eslint-errors`](https://www.npmjs.com/package/suppress-eslint-errors)
to suppose the violations. I'll take a pass at cleaning this up at some
point in the future, and let's do our best to address these in the
future as we come across them :)

This'll help ensure new code being added to this repo is held to the
same standard as code in Browsertrix's frontend.
2024-03-07 20:12:50 -05:00
Emma Segal-Grossman b39d17d637 Tab list disappears with an empty WARC (#284)
Closes #283 

Not too sure what the root of the problem actually is, but removing the
overflow seems to fix it, though it does change the sizing somewhat.
I've adjusted the padding to compensate, so it should look the same as
it did before.

The source rules are coming from Bulma, which I don't know super well,
so I don't mind overriding it in this context rather than trying to fix
the underlying issue here.
2024-02-21 19:21:45 -08:00
Emma Segal-Grossman a63390f10c Update NPM packaging, linting, and a bunch of types (#275)
Preparation for
https://github.com/webrecorder/archiveweb.page/issues/198 /
https://github.com/webrecorder/archiveweb.page/pull/199.

## Changes

- Organizes published files more cleanly, using `dist/types` folder as
the target for type declarations and sourcemaps
- Configures type field in `package.json`
- Updates ESLint & its config
  - Sets up type-informed linting rules mirroring browsertrix
- Adds a bunch of other useful eslint and eslint-typescript rules, and
applies auto-fixes to the codebase
- Cleans up a bunch of types throughout the codebase, particularly parts
of the code used by ArchiveWebPage
- Changes `ItemIndex#_deleting` from `private` to `protected` so that a
part of AWP that extends it can do so properly
- Makes a bunch of previously-implied [non-null
assertions](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#non-null-assertion-operator-postfix-)
explicit
- Updates `URLResource` and `ItemType` types (and renames `Item` →
`ItemType` to disambiguate from the `Item` class)
- Removes `node-sass` and replaces it with `sass-embedded` for much
quicker installs and compilation
2024-02-06 18:50:12 -08:00
Emma Segal-Grossman a40471128f Fix missed rename, and improve types (#276)
Fixes a missed rename, in `src/item-index.ts`: I'd renamed `coll` to
`item` but missed updating it in the `update` method's
`changedProperties` map.

This PR fixes that, and adds better typing to all of the instances of
`changedProperties` by using
[`PropertyValues<this>`](https://lit.dev/docs/components/lifecycle/#typescript-types-for-changedproperties),
and implementing class properties for missing Lit properties.
2024-01-05 18:32:22 -08:00
emma 8f7ce42913 chore: ignore dist in eslint config 2023-12-04 14:38:09 -08:00
emma 3056ec79e4 Merge branch 'main' into dev-2.0.0 2023-11-29 23:12:32 -05:00
Emma Segal-Grossman ad38694598 Typescript migration part 2 (#261)
Converts everything to typescript, adding `@ts-expect-error`s where
necessary. Also makes some progress converting elements to use
decorators, but we're not fully there yet — I think it'll make sense to
continue to do that in future PRs, rather than doing it all in one go,
just so that we can keep up with the dev branch.
2023-11-29 15:53:48 -05:00
emma e9438eb724 improve typescript and linting usage across codebase
add ts-lit-plugin and eslint-typescript

disable no-invalid-css rule

fix a bunch of errors raised by eslint and typescript

run prettier & eslint on the remaining files

remove unused imports

split coll-index into index and info components...
and rename "coll" -> "item" for these.
also includes some fixes for previously-undocumented properties used on
non-ts elements.

extract labeled fields into separate component...
and make a few type improvements too

swap custom copy button for shoelace one

rename a few more missed things
2023-11-29 15:53:46 -05:00
emma e7b86626df move archive info into a dialog in dropdown menu (#235)
using sl-dialog and sl-button for components

show error message when coll info is missing

rework info popup to better match 2.0 design

remove extra comment i forgot
2023-11-29 15:52:12 -05:00