rdme icon indicating copy to clipboard operation
rdme copied to clipboard

v9 milestone

Open kanadgupta opened this issue 1 year ago • 6 comments

  • [ ] Add deprecation notice to docs commands
  • [ ] Remove workingDirectory argument from openapi family of commands (RM-7754, #904)
  • [ ] https://github.com/readmeio/rdme/issues/645
  • [ ] #962
  • [ ] Auto-publish GitHub releases (e.g., remove gh CLI usage)
  • [ ] Remove lastUpdatedHash insertion (internal ticket)
  • [x] Make sure JSON import assertions are future-proof (or aren't used at all) https://github.com/readmeio/rdme/pull/993
  • [x] #889
  • [x] Migrate to ESM (#856)
    • [x] Do some QA to ensure no Node ExperimentalWarnings show up https://github.com/readmeio/rdme/pull/901
  • [x] Drop support for Node 14 + 16 (release schedule) https://github.com/readmeio/rdme/pull/900
    • [x] Bump lockfile to v3
  • [x] Remove docs:edit command https://github.com/readmeio/rdme/pull/902
  • [x] Remove oas command https://github.com/readmeio/rdme/pull/902
  • [x] Remove swagger command https://github.com/readmeio/rdme/pull/902
  • [x] (Probably separate from the ESM migration) look into any clean-up/modernizations we can do in the tsconfig https://github.com/readmeio/rdme/pull/905
  • [x] flip the isPublic flag in the versions:create and versions:update commands to be hidden so it's consistent with the other flags and with our API endpoints https://github.com/readmeio/rdme/pull/906
  • [x] https://github.com/readmeio/rdme/pull/895
  • [x] #857
  • [x] Use native Node 18 fetch and FormData ~~and msw~~ in favor of node-fetch ~~and nock~~ and formdata-node, convert everything over accordingly #1000

lower priority

  • [ ] Volta guidance?
  • [ ] Remove logic for triple tagging (i.e. v9, v9.0.0, ~~9.0.0~~)
  • [ ] Optimize GHA build process

kanadgupta avatar Apr 18 '23 16:04 kanadgupta

Maybe we also migrate to ESM? 😬

kanadgupta avatar Jul 05 '23 19:07 kanadgupta

fwiw, iirc last time i looked into that you still needed to pass the --experimental flag to Node for ESM in order to run bin/rdme. That was like a year and a half ago though, and before we migrated to TS, so maybe things are different now.

erunion avatar Jul 05 '23 19:07 erunion

maybe we also drop Node 16 support also when that is EOL in a few weeks. we'll want to bump the version here (in addition to everywhere else):

https://github.com/readmeio/rdme/blob/9756d95f510d05d2b4cdacddf91d509b287291e0/Dockerfile#L1

kanadgupta avatar Aug 01 '23 17:08 kanadgupta

Now that we've got rdme guides and rdme guides:prune aliased to rdme docs:<cmd> can we deprecate and remove rdme docs?

erunion avatar Sep 13 '23 20:09 erunion

@erunion ah yeah good callout — definitely down to add a deprecation notice but i don't think we should remove those until we're using the new /guides routes

kanadgupta avatar Sep 13 '23 20:09 kanadgupta

For dumping node-fetch and formdata-node for native fetch the place where you're using formdata-node in https://github.com/readmeio/rdme/pull/856 can be replaced with this diff:

diff --git a/src/lib/streamSpecToRegistry.ts b/src/lib/streamSpecToRegistry.ts
index a73445f..9d4f68a 100644
--- a/src/lib/streamSpecToRegistry.ts
+++ b/src/lib/streamSpecToRegistry.ts
@@ -1,8 +1,4 @@
-import fs from 'node:fs';
-
-import { FormData } from 'formdata-node';
 import ora from 'ora';
-import { file as tmpFile } from 'tmp-promise';
 
 import { debug, oraOptions } from './logger.js';
 import readmeAPIFetch, { handleRes } from './readmeAPIFetch.js';
@@ -15,23 +11,15 @@ import readmeAPIFetch, { handleRes } from './readmeAPIFetch.js';
  */
 export default async function streamSpecToRegistry(spec: string) {
   const spinner = ora({ text: 'Staging your API definition for upload...', ...oraOptions() }).start();
-  // Create a temporary file to write the bundled spec to,
-  // which we will then stream into the form data body
-  const { path } = await tmpFile({ prefix: 'rdme-openapi-', postfix: '.json' });
-  debug(`creating temporary file at ${path}`);
-  await fs.writeFileSync(path, spec);
-  const stream = fs.createReadStream(path);
-
-  debug('file and stream created, streaming into form data payload');
+  debug('preparing spec into form data payload');
   const formData = new FormData();
-  formData.append('spec', {
-    type: 'application/json',
-    name: 'openapi.json',
-    [Symbol.toStringTag]: 'File',
-    stream() {
-      return stream;
-    },
-  });
+  formData.append(
+    spec,
+    new Blob([spec], {
+      type: 'application/json',
+    }),
+    'openapi.json',
+  );
 
   const options = {
     body: formData,

erunion avatar Sep 14 '23 20:09 erunion