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

No package.json in curated #641

Open
gsnedders opened this issue Jun 24, 2022 · 2 comments
Open

No package.json in curated #641

gsnedders opened this issue Jun 24, 2022 · 2 comments

Comments

@gsnedders
Copy link

Currently you can install main but not curated, which doesn't seem great if you want people to use curated rather than main, especially when they want access to things not included in any extract.

@gsnedders
Copy link
Author

I guess what I'd like is to be able to do something like:

import webref from 'webref/ed';

const dfns = webref.listAll(webref.dfns);
const css = webref.listAll(webref.css);

Or something?

tidoust added a commit that referenced this issue Jun 27, 2022
This should allow users to install the curated branch of Webref directly from
npm and then import it from code (see #641):

```
npm install "https://github.com/w3c/webref.git#curated"
```

```js
import webref from 'webref/ed' assert { type: 'json' };
```

Note that we don't currently update the overall version of the Webref package
(it stays at `0.0.1`) and don't provide the JS logic (`listAll`) that exists
in the released `@webref/xxx` packages (that logic is in the `curated` branch
but not in the `ed` folder).
tidoust added a commit that referenced this issue Jun 28, 2022
This should allow users to install the curated branch of Webref directly from
npm and then import it from code (see #641):

```
npm install "https://github.com/w3c/webref.git#curated"
```

```js
import webref from 'webref/ed' assert { type: 'json' };
```

Note that we don't currently update the overall version of the Webref package
(it stays at `0.0.1`) and don't provide the JS logic (`listAll`) that exists
in the released `@webref/xxx` packages (that logic is in the `curated` branch
but not in the `ed` folder).
@tidoust
Copy link
Member

tidoust commented Jun 28, 2022

Not exactly as smooth as you might want it to be, but "something" nevertheless: the curated branch now has a package.json file. This allows you to do:

npm install https://github.com/w3c/webref.git#curated

... and use it in scripts through code like:

import webref from 'webref/ed/index.json' assert { type: 'json' };
import netinfo from 'webref/ed/dfns/netinfo.json' assert { type: 'json' };

I'll look into adding convenience methods in JS such as listAll to make it easier to expose and consume the data.

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

No branches or pull requests

2 participants