Git Product home page Git Product logo

basetag's Introduction

👋 Hi, I'm Jannik

indie maker /// software engineer

always learning, always looking for great projects and ideas

I make 🚧

  • mmry — A personal search engine 🧠
  • vue-notion — An unofficial Notion renderer for Vue ✨
  • TitleRun — The game that only exists in your title bar 👾

I like 🌎

  • JavaScript/Typescript
  • React, Solid, Vue
  • Tailwind
  • Python, (sklearn, Huggingface, etc.)
  • Rust, Go

basetag's People

Contributors

janniks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

basetag's Issues

Why does basetag only work as dependency but not devDependency?

Hi, I have just tried out this awesome package, and it works great! However one thing I notice is that I doesn't work when I install it as devDependency.

Why is that? If I am correct, postinstall script would execute regardless a package being dependency or devDependency.

Needs local postinstall script

It seems that any time you run npm install it will clean out unrecognized files and directories, such as node_modules/$, but it doesn't re-run the postinstall scripts.

I think this should create a postinstall key in the local package.json to run npx basetag (for which a script would need to be provided), and print a message letting the user know to do so if a different postinstall already exists.

'@' instead of '$'

If there's ever a v2 of this, I'd recommend using @ rather than $.

  • @ is commonly used to denote "home", "here" or "at", and "link"
  • @ is npm's existing convention for scoping packages
  • $ is commonly used to denote "end of"
  • $ is recognized as a shell variable and therefore must be escaped

Could not find node_modules directory in __dirname on install

Hello, I am using node v12.18.3 and npm version 6.14.6 on Windows When I try to install the package, I get the following message:
`[email protected]

  • Could not find node_modules directory in __dirname
  • Not creating $ symlink`

I'm not sure what seems to be causing this issue. I tried remove the node_modules folder and re-running npm i but that didn't seem to fix the issue. Any help would be greatly appreciated.

when using in docker, link points to local fs

full branch is here: brave-intl/bat-ratios#69

➜  bat-ratios git:(add-basetag) ✗ docker-compose -f docker-compose.yml run -v $(pwd):/usr/src/app -w /usr/src/app ratios-history ls -la node_modules/$
Creating bat-ratios_ratios-history_run ... done
lrwxrwxr-x    1 root     root            56 Jan 27 05:48 node_modules/$ -> /Users/michaelmclaughlin/Documents/brave-intl/bat-ratios

symlink should instead be pointing to local filesystem's relative path? perhaps i am just dockering wrong

Incorrect behaviour of `basetag rebase` on Windows

Expected Behavior

$ pnpm basetag rebase

# app\common\domain\errors\index.js
  ../../infrastructure/Config.js -> $/app/common/infrastructure/Config.js

# app\common\infrastructure\Config.js
  ../../../package.json" assert { type: "json -> $/package.json" assert { type: "json
...

Current Behavior

$ pnpm basetag rebase

# app\common\domain\errors\index.js
  ../../infrastructure/Config.js -> $\app\common\infrastructure\Config.js

# app\common\infrastructure\Config.js
  ../../../package.json" assert { type: "json -> $\package.json" assert { type: "json
...

Problem description

rebase should use / path separator in require/import statements.
\, aka Windows path.sep, means escaping symbols in this case. It leads to such an error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '$appcommoninfrastructureConfig.js'...

Possible solution

Replace \ to / in pkgPath variable forcibly.

Environment

  • basetag 2.1.0
  • node 18.14.0
  • pnpm 8.2.0
  • Win 10

Link relative rather than absolute?

I have a build and deploy process in which the build happens in a temp directory and then deploys to a different directory to be run.

When this happens there's an error because $ points to /tmp/random-name rather than ../.

Does not work with ES6 import

For reasons, I'm not clear on yet, this does not seem to work with ES6 imports on Node 14.

For example, this does not work:
import db from '$/lib/db.js'

But this does:
const db = require('$/lib/db')

The resulting error looks like this:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '$' imported from /Users/jd/dev/my-app/my-file.mjs
    at packageResolve (internal/modules/esm/resolve.js:655:9)
    at moduleResolve (internal/modules/esm/resolve.js:696:18)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
    at Loader.resolve (internal/modules/esm/loader.js:85:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:229:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:51:40)
    at link (internal/modules/esm/module_job.js:50:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

At a high level, it looks like Node might be resolving packages for an import in a completely different fashion, perhaps making basetag incompatible. Or I'm missing something.

Tool to re-root, de-root existing project.

I discovered this because I've inherited a project with (literally) hundreds of files, many deeply nested.

(I was searching around a bit after having realized Windows symlinks wouldn't work - not yet knowing about junctions - and stumbled upon a blog that mentioned this while hoping to find an updated 'official' solution)

Anyway, I'm writing a tool that will convert a project's requires over to "the basetag way". It may provide a nice starting point to build something that could be put in this project as a bin script and be able to do something like this:

npx basetag rebase-requires

does not work within docker

works properly on my development machine
but once deployed on docker, it states

Error while running command start: Could not load function /usr/src/app/config/functions/cron.js: Cannot find module '$/util/logger'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.