chore(DRAFT): use acorn
, estree
and esrap
Can we just use single quotes everywhere?
The Drizzle adder creates the drizzle.config.ts
below currently:
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
export default defineConfig({
schema: "./src/lib/server/db/schema.ts",
dbCredentials: {
url: process.env.DATABASE_URL
},
verbose: true,
strict: true,
dialect: "sqlite"
});
recast is using babel, which is much less used in the Svelte ecosystem, so folks wouldn't generally be as familiar with it
Benefits
svelte
ecosystemesrap
Downsides
esrap
Depends on Rich-Harris/esrap#13. Currently published as esrap-typescript-temp
for ease of use for testing. Otherwise, this would require using pnpm link
locally with the branch mentioned before.
If we want to proceed with this (which i think we should), this needs to be done
packages/ast-tooling/ts-estree.ts
seperately so that it can also be used inside esrap
. Later they should probably live inside acorn-typescript
once we fork itesrap
understand what a TSModuleDeclaration
is and how to print itesrap
according to the types above. This will probably also require way more types in this new packageesrap
and publish itLatest commit: 53921b6
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
publish packages/ast-tooling/ts-estree.ts seperately so that it can also be used inside esrap. Later they should probably live inside acorn-typescript once we fork it
I think it'd be preferrable to just duplicate it in the short-term than to add a dependency on ast-tooling
from esrap
. Hopefully that can be short-lived and we can just add it to the acorn-typescript
fork like you suggest
update types inside esrap according to the types above. This will probably also require way more types in this new package
That would be nice, but I wouldn't necessarily block on it. It will be a huge cleanup just to get this done and get off of recast, so if there are some things left for followups that would be fine
I think it'd be preferrable to just duplicate it in the short-term than to add a dependency on
ast-tooling
fromesrap
. Hopefully that can be short-lived and we can just add it to theacorn-typescript
fork like you suggest
I was thinking about a custom package just for those types, but copying over should also work, if we want proceed with this
Closing, as this PR is hopelessly outdated. The esrap TS PR has been merged, but esrap is just not ready enough for handling such stuff, especially regarding tabs vs spaces and single vs double quoutes.