Skip to content
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

common Exporting common util #865

Merged
merged 10 commits into from
Jan 9, 2025
Merged

Conversation

mtuchi
Copy link
Collaborator

@mtuchi mtuchi commented Dec 11, 2024

Summary

Fixes namespacing of util functions in common and exports the utils properly for use by other adaptors.

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

@josephjclark
Copy link
Collaborator

Alright - the problems here are all do with how our docs generator decides the namespace for a given function. It's a very rigid and limiting system at the moment which just uses the filename and assumes that's it.

I'll add a jsdoc extension to give us more control over this

@josephjclark
Copy link
Collaborator

@mtuchi this should now be working

image

I've tested with this job:

fn(state => {
  const formatted = dateFns.format(new Date(), 'yyyy');
  console.log(formatted);

  return state;
});

http.get('https://jsonplaceholder.typicode.com/todos/1').then(state => {
  console.log(state);
  return state;
});

fn(state => {
  console.log('testing util namespace ');
  const a = util.encode('xxx');
  console.log(a);
  const b = util.decode(a);
  console.log(b);

  console.log(util.uuid());

  return state;
});

@josephjclark
Copy link
Collaborator

@josephjclark josephjclark marked this pull request as ready for review January 7, 2025 16:46
@josephjclark josephjclark changed the base branch from main to release/common-next January 7, 2025 17:29
@mtuchi mtuchi mentioned this pull request Jan 9, 2025
12 tasks
@mtuchi
Copy link
Collaborator Author

mtuchi commented Jan 9, 2025

Hiya @josephjclark i have tested this PR everything looks good ✅ , Before you merge can you take a look at this PR #888
it's just a cleanup on http adaptor on exporting util function properly. I have used common-helpers as the base branch

@josephjclark josephjclark merged commit 001301b into release/common-next Jan 9, 2025
1 check passed
@josephjclark josephjclark deleted the common-helpers branch January 9, 2025 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants