Skip to content

#17: Replace resource.js with ouroboros#18

Merged
gabesullice merged 9 commits intomainfrom
ouroboros
Jun 23, 2025
Merged

#17: Replace resource.js with ouroboros#18
gabesullice merged 9 commits intomainfrom
ouroboros

Conversation

@kostiukevych-ls
Copy link
Contributor

@kostiukevych-ls kostiukevych-ls commented Jun 13, 2025

Closes #17

@kostiukevych-ls kostiukevych-ls self-assigned this Jun 13, 2025
@kostiukevych-ls kostiukevych-ls linked an issue Jun 13, 2025 that may be closed by this pull request
Copy link
Member

@gabesullice gabesullice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kostiukevych-ls !

This looks good from a business logic perspective, but there's a missing piece: @applura/ouroboros needs to be bundled into the build artifact so that the client will work in users' projects via our CDN.

When I run npm run build I'm warned about unresolved dependencies:
image

Following the link to https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency suggests that we need to add https://github.com/rollup/plugins/tree/master/packages/node-resolve

package.json Outdated
"build": "rollup index.js --file dist/v2.js",
"check": "npm run fmt -- --check && npm run lint && npm test",
"test": "deno test --allow-net",
"test": "deno install && deno test --allow-net",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? Could it be addressed by updating the GitHub workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. Thank you for comment. Updated

@kostiukevych-ls
Copy link
Contributor Author

@gabesullice Thank you for your comments. I'm not entirely sure if I implemented everything correctly—could you please take a look? Let me know if there's anything else I should update or change.

const { nodeResolve } = require("@rollup/plugin-node-resolve");

module.exports = {
input: "src/cli.js",
Copy link
Member

@gabesullice gabesullice Jun 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried to run the build, but this config can't be right because this file doesn't exist.

Can you run the build and verify it works? If it does work, I think it means we don't need this input configuration at all and should remove it so it doesn't confuse us later.

Copy link
Member

@gabesullice gabesullice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kostiukevych-ls! There's a couple bits of dead code, probably from debugging. This works as expected though, so I'll just push a commit to clean them up.

const { nodeResolve } = require("@rollup/plugin-node-resolve");

module.exports = {
input: "index.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
input: "index.js",

I don't think we need this line.

output: {
file: "dist/v2.js",
},
plugins: [nodeResolve()],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

package.json Outdated
"rollup": "^3.8.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.6",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@rollup/plugin-commonjs": "^28.0.6",

Not needed.

@gabesullice gabesullice merged commit df1569d into main Jun 23, 2025
1 check passed
@gabesullice gabesullice deleted the ouroboros branch June 23, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace resource.js with ouroboros

2 participants