Skip to content

Commit

Permalink
feat: resolve short official plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Aug 19, 2019
1 parent 5a7680d commit 22ca74c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/@nodepack/utils/src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ const pluginRE = /^(@nodepack\/|nodepack-|@[\w-]+\/nodepack-)plugin-/
const scopeRE = /^@[\w-]+\//
const officialRE = /^@nodepack\//

const officialPlugins = [
'babel',
'express',
'typescript',
]

/**
* @param {string} id
*/
Expand All @@ -26,6 +32,15 @@ exports.resolvePluginId = id => {
if (pluginRE.test(id)) {
return id
}

if (id === '@nodepack/service') {
return id
}

if (officialPlugins.includes(id)) {
return `@nodepack/plugin-${id}`
}

// scoped short
// e.g. @nodepack/foo, @bar/foo
if (id.charAt(0) === '@') {
Expand Down

0 comments on commit 22ca74c

Please sign in to comment.