{"id":22622221,"url":"https://github.com/ull-esit-pl/babel-left-side-npm-test","last_synced_at":"2025-10-03T19:49:30.575Z","repository":{"id":266485718,"uuid":"898485446","full_name":"ULL-ESIT-PL/babel-left-side-npm-test","owner":"ULL-ESIT-PL","description":"Testing Pablo's @ull-esit-pl/parser-left-side set of packages in GitHub registry","archived":false,"fork":false,"pushed_at":"2025-01-01T14:05:33.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-03T12:43:46.380Z","etag":null,"topics":["babel-parser","left-side"],"latest_commit_sha":null,"homepage":"https://github.com/ULL-ESIT-PL/parser-left-side-crguezl","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ULL-ESIT-PL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T13:33:55.000Z","updated_at":"2024-12-25T17:17:55.000Z","dependencies_parsed_at":"2024-12-04T14:32:26.416Z","dependency_job_id":"fb3326b3-20fb-4926-8d27-d776eacd0685","html_url":"https://github.com/ULL-ESIT-PL/babel-left-side-npm-test","commit_stats":null,"previous_names":["ull-esit-pl/babel-left-side-npm-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULL-ESIT-PL%2Fbabel-left-side-npm-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULL-ESIT-PL%2Fbabel-left-side-npm-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULL-ESIT-PL%2Fbabel-left-side-npm-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULL-ESIT-PL%2Fbabel-left-side-npm-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ULL-ESIT-PL","download_url":"https://codeload.github.com/ULL-ESIT-PL/babel-left-side-npm-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246128393,"owners_count":20727899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel-parser","left-side"],"created_at":"2024-12-08T23:13:40.561Z","updated_at":"2025-10-03T19:49:25.525Z","avatar_url":"https://github.com/ULL-ESIT-PL.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is this?\n\n\u003e [!CAUTION]\n\u003e This is a work in progress. The syntax and the semantic of the proposed extension to JavaScript are not yet fully defined and tested. The packages are published in the GitHub registry, but they are not ready for production.\n\n\nThis branch of this  repo illustrates how to use \nPablo Santana's set of packages [published in the GitHub registry](https://github.com/orgs/ULL-ESIT-PL/packages) inside the [ull-esit-pl](https://github.com/ULL-ESIT-PL/) organization. To see how to use the packages published from the repo [ULL-ESIT-PL-2425/parser-left-side-crguezl](https://github.com/ULL-ESIT-PL-2425/parser-left-side-crguezl) go to the branch [crguezl](https://github.com/ULL-ESIT-PL/babel-left-side-npm-test/tree/crguezl) of this repo. \n\n\nThese packages extend the JavaScript language with a new kind of functions. The packages are:\n\n- The JS parser modified: [@ull-esit-pl/parser-left-side](https://github.com/orgs/ULL-ESIT-PL/packages/npm/package/parser-left-side)\n- The AST transformation plugin: [@ull-esit-pl/babel-plugin-left-side-plugin ](https://github.com/orgs/ULL-ESIT-PL/packages/npm/package/babel-plugin-left-side-plugin) \n- The support library: [@ull-esit-pl/babel-plugin-left-side-support](https://github.com/orgs/ULL-ESIT-PL/packages/npm/package/babel-plugin-left-side-support) \n\n### The proposed Syntax and Semantic\n\nThese packages extend JS  with a new kind of functions, the `@@` functions (we lack of a name for this class of functions: *assignable*? *pure*?). Here is an example of declaring an *assignable* function:\n\n```js \nfunction @@ foo(bar) {\n  return bar * 2;\n}\n```\n\nThese *assignable* functions can be later modified  using the assign expression:\n\n```js\nfoo(10) = 5;\n```\n\nHere is the full code for our \"hello\" left-side-plugin example:\n\n`➜  babel-npm-test git:(main) cat example.js`\n```js\nfunction @@ foo(bar) {\n  return bar * 2;\n}\nfoo(10) = 5;\n\nconsole.log(foo(10)); //  5\nconsole.log(foo(5));  // 10\n```\n\nYou can fork this repo and test the packages in your own workspace.\n\n## Install\n\n```bash\nHere are the node and npm versions I have used to test the packages:\n\n```bash\n➜  babel-npm-test node --version\nv20.5.0\n➜  babel-npm-test npm --version\n9.8.0\n```\n\nThese packages use the GitHub registry instead of the npm registry. Therefore, remember\nto set the registry entry in your `.npmrc` file:\n\n```bash\n➜  babel-npm-test git:(main) ✗ cat ~/.npmrc | grep '@ull-esit-pl:'\n@ull-esit-pl:registry=https://npm.pkg.github.com\n```\n\nor set an entry `registry` in your `package.json` file:\n\n```bash\n➜  babel-npm-test git:(main) ✗ jq '.registry' package.json \n\"https://npm.pkg.github.com\"\n```\n\nThen you can proceed to install the packages:\n\n```\nnpm i -D @babel/cli@7.10 @ull-esit-pl/babel-plugin-left-side-plugin @ull-esit-pl/babel-plugin-left-side-support @ull-esit-pl/parser-left-side \n```\n\nYour package.json `devDependencies` section will look similar to this:\n\n`➜  babel-left-side-npm-test git:(main) ✗ jq '.devDependencies' package.json`\n```json\n{\n  \"@babel/cli\": \"^7.10.1\",\n  \"@ull-esit-pl/babel-plugin-left-side-plugin\": \"latest\",\n  \"@ull-esit-pl/babel-plugin-left-side-support\": \"latest\",\n  \"@ull-esit-pl/parser-left-side\": \"latest\"\n}\n```\n\n\n## Compiling the code\n\nTo compile the example above add a `babel.config.js` to your workspace folder:\n\n`➜  babel-npm-test git:(main) cat babel.config.js`\n```js\nmodule.exports = {\n  \"plugins\": [\n    \"@ull-esit-pl/babel-plugin-left-side-plugin\"\n  ],\n}\n```\n\nand then compile it using the installed packages:\n\n```js\n➜  babel-npm-test npx babel  example.js\n```\nThis will output the compiled code to the console:\n\n```js                                                      \nconst {\n  assign,\n  functionObject\n} = require(\"@ull-esit-pl/babel-plugin-left-side-support\");\nconst foo = functionObject(function (bar) {\n  return bar * 2;\n});\nassign(foo, [10], 5);\nconsole.log(foo(10));\nconsole.log(foo(5));\n```\n\nIf you want to save it to a file, use the `-o` option.\n\n## Running\n\nYou can pipe the output to `node`:\n\n```bash\n➜  babel-npm-test npx babel  example.js | node  -\n5\n10\n```\n\nor alternatively, use the `-o` option to save the output to a file and then run it:\n\n```\n➜  babel-left-side-npm-test git:(main) npx babel  example.js -o example.cjs\n➜  babel-left-side-npm-test git:(main) ✗ node example.cjs \n5\n10\n```\n\n## References\n\n- Our tutorial on babel: https://github.com/ULL-ESIT-PL/babel-learning/tree/main\n- A tutorial in it describing how thhe packages are published: https://github.com/ULL-ESIT-PL/babel-learning/blob/main/doc/building-publishing.md\n- Branch pablo-tfg with the actual code implementation: https://github.com/ULL-ESIT-PL/babel-tanhauhau/tree/pablo-tfg\n- Some internal information: https://github.com/ULL-ESIT-PL/beca-colaboracion/tree/main\n- The original idea of the project is based on what is explained in this draft: https://www.authorea.com/users/147476/articles/1235078-function-expressions-on-the-left-side-of-assignments (submitted now to Science of Computer Programming\n journal)\n\n## TODO\n\n- We need version numbers to control the progress\n- README.md is the one babel has. It has to change to be specific about the extension for the three packages,\n- Add `-D` to all install instructions and remove the version number: `npm install @ull-esit-pl/babel-plugin-left-side-plugin -D`\n- Do we need two separated packages for the plugin and the support? Can we have a single package?\n\n## License\n\n[MIT](https://couto.mit-license.org/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Full-esit-pl%2Fbabel-left-side-npm-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Full-esit-pl%2Fbabel-left-side-npm-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Full-esit-pl%2Fbabel-left-side-npm-test/lists"}