Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

How to properly reference Atom's node packages from user packages? #2548

Closed

Description

@p-e-w

This is ugly, but I found no other way to include Grammar from the first-mate package. What is the "proper" method?

Activity

  1. lee-dohm commented on Jun 7, 2014

    @lee-dohm
    Contributor

    To my understanding, first-mate doesn't export Grammar. But if you were trying to import something that first-mate exports, like GrammarRegistry, you could do the following:

    1. Add first-mate to the package.json of your package in the dependencies section, like seen here: https://github.com/atom/whitespace/blob/master/package.json#L11
    2. Run apm install in the package directory when developing. This installs your package's npm dependencies
    3. Use {GrammarRegistry} = require 'first-mate' in your source
  2. p-e-w commented on Jun 8, 2014

    @p-e-w
    ContributorAuthor

    True, turns out that Grammar is not exported. I hadn't even considered that possibility since Grammar is explicitly listed in the API docs :)

    I have filed a pull request to export the class as I believe it is a good idea to allow developers to create their own language grammars in JS.

  3. lock commented on Jan 26, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  4. locked as resolved and limited conversation to collaborators on Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions