Package is JSON file with links.

For example: https://gist.github.com/ivansglazunov/4cf14e3e58f4e96f7e7914b963ecdd29

<aside> ❕ Packager does not take on the task of dealing with dependencies. Implementing an adapter to npm and other package managers will allow you to take advantage of their mechanics. Packager takes on the task of transporting links to packages and back, based on the fact that the issue of installing dependencies either does not need to be solved or has already been resolved.

</aside>

Packager is part of deeplinks backend system.

By default only admin link have rule permission allows action AllowInsert for objects PackagerQuery , PackagerInstall and PackagerPublish

Token for github you can create here: https://github.com/settings/tokens/new

In alpha version, you need to search packages here https://gist.github.com/search?q=filename%3Adeep.json

In future versions, we realize many store providers to many package managers as npm, nugets, gems...

In future versions, we realize useful search interface for packages.

Install

// insert query
const { data: [{ id: packageQueryId }] } = await deep.insert({
  type_id: await deep.id('@deep-foundation/core', 'PackagerQuery'),
	string: { data: { value: '[<https://[email protected]/ivansglazunov/4cf14e3e58f4e96f7e7914b963ecdd29>](<https://gist.github.com/ivansglazunov/4cf14e3e58f4e96f7e7914b963ecdd29>)' } },
});
// initiate installation
const { data: [{ id: packageInstallId }] } = await deep.insert({
  type_id: await deep.id('@deep-foundation/core', 'PackagerInstall'),
	from_id: deep.linkId, // actual user only can be here
	to_id: packageQueryId,
});
// you can await promise of all operations about this link
await deep.await(packageInstallId);

Publish

// insert query
const { data: [{ id: packageQueryId }] } = await deep.insert({
  type_id: await deep.id('@deep-foundation/core', 'PackagerQuery'),
	string: { data: {
		value: '[<https://[email protected]/ivansglazunov/4cf14e3e58f4e96f7e7914b963ecdd29>](<https://gist.github.com/ivansglazunov/4cf14e3e58f4e96f7e7914b963ecdd29>)'
	}, },
});
// package must be already exists, for example you have packageId variable
const { data: [{ id: packagePublishId }] } = await deep.insert({
  type_id: await deep.id('@deep-foundation/core', 'PackagerPublish'),
	from_id: packageId, // actual user only can be here
	to_id: packageQueryId, // where you want to publish it
});
// you can await promise of all operations about this link
await deep.await(packagePublishId);

Packager do not allow you manual version control.

If you publish package - package version automatically update.

In next versions, Packager will compare difference already published, and local package, for calculate patch/minor/major version update using semver standard.

Publish new gist

The publication of a new package occurs automatically if the line does not contain the id / name of a specific package in the package store.

// insert query
const { data: [{ id: packageQueryId }] } = await deep.insert({
  type_id: await deep.id('@deep-foundation/core', 'PackagerQuery'),
	string: { data: {
		value: '[<https://[email protected]/ivansglazunov>](<https://gist.github.com/ivansglazunov/4cf14e3e58f4e96f7e7914b963ecdd29>)' // here only name without gistId 
	}, },
});
// package must be already exists, for example you have packageId variable
const { data: [{ id: packagePublishId }] } = await deep.insert({
  type_id: await deep.id('@deep-foundation/core', 'PackagerPublish'),
	from_id: packageId, // actual user only can be here
	to_id: packageQueryId, // where you want to publish it
});
// you can await promise of all operations about this link
await deep.await(packagePublishId);

Advanced manual usage