@stencil/vue-output-target
Advanced tools
Comparing version 0.0.1-dev.11722471207.1c61e7f2 to 0.0.1-dev.11722540458.1506f4d7
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var path = require('path'); | ||
@@ -7,3 +9,8 @@ var util = require('util'); | ||
const readFile = util.promisify(fs.readFile); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var path__default = /*#__PURE__*/_interopDefaultLegacy(path); | ||
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); | ||
const readFile = util.promisify(fs__default['default'].readFile); | ||
const toLowerCase = (str) => str.toLowerCase(); | ||
@@ -53,3 +60,3 @@ const dashToPascalCase = (str) => toLowerCase(str) | ||
function relativeImport(pathFrom, pathTo, ext) { | ||
let relativePath = path.relative(path.dirname(pathFrom), path.dirname(pathTo)); | ||
let relativePath = path__default['default'].relative(path__default['default'].dirname(pathFrom), path__default['default'].dirname(pathTo)); | ||
if (relativePath === '') { | ||
@@ -61,6 +68,6 @@ relativePath = '.'; | ||
} | ||
return normalizePath(`${relativePath}/${path.basename(pathTo, ext)}`); | ||
return normalizePath(`${relativePath}/${path__default['default'].basename(pathTo, ext)}`); | ||
} | ||
async function readPackageJson(rootDir) { | ||
const pkgJsonPath = path.join(rootDir, 'package.json'); | ||
const pkgJsonPath = path__default['default'].join(rootDir, 'package.json'); | ||
let pkgJson; | ||
@@ -149,4 +156,4 @@ try { | ||
function generateProxies(config, components, pkgData, outputTarget, rootDir) { | ||
const distTypesDir = path.dirname(pkgData.types); | ||
const dtsFilePath = path.join(rootDir, distTypesDir, GENERATED_DTS); | ||
const distTypesDir = path__default['default'].dirname(pkgData.types); | ||
const dtsFilePath = path__default['default'].join(rootDir, distTypesDir, GENERATED_DTS); | ||
const componentsTypeFile = relativeImport(outputTarget.proxiesFile, dtsFilePath, '.d.ts'); | ||
@@ -200,4 +207,4 @@ const pathToCorePackageLoader = getPathToCorePackageLoader(config, outputTarget); | ||
} | ||
const srcDirectory = path.join(__dirname, '..', 'vue-component-lib'); | ||
const destDirectory = path.join(path.dirname(outputTarget.proxiesFile), 'vue-component-lib'); | ||
const srcDirectory = path__default['default'].join(__dirname, '..', 'vue-component-lib'); | ||
const destDirectory = path__default['default'].join(path__default['default'].dirname(outputTarget.proxiesFile), 'vue-component-lib'); | ||
return config.sys.copy([ | ||
@@ -216,8 +223,8 @@ { | ||
const distOutputTarget = (_a = config.outputTargets) === null || _a === void 0 ? void 0 : _a.find((o) => o.type === 'dist'); | ||
const distAbsEsmLoaderPath = (distOutputTarget === null || distOutputTarget === void 0 ? void 0 : distOutputTarget.esmLoaderPath) && path.isAbsolute(distOutputTarget.esmLoaderPath) | ||
const distAbsEsmLoaderPath = (distOutputTarget === null || distOutputTarget === void 0 ? void 0 : distOutputTarget.esmLoaderPath) && path__default['default'].isAbsolute(distOutputTarget.esmLoaderPath) | ||
? distOutputTarget.esmLoaderPath | ||
: null; | ||
const distRelEsmLoaderPath = config.rootDir && distAbsEsmLoaderPath ? path.relative(config.rootDir, distAbsEsmLoaderPath) : null; | ||
const distRelEsmLoaderPath = config.rootDir && distAbsEsmLoaderPath ? path__default['default'].relative(config.rootDir, distAbsEsmLoaderPath) : null; | ||
const loaderDir = outputTarget.loaderDir || distRelEsmLoaderPath || DEFAULT_LOADER_DIR; | ||
return normalizePath(path.join(basePkg, loaderDir)); | ||
return normalizePath(path__default['default'].join(basePkg, loaderDir)); | ||
} | ||
@@ -257,4 +264,4 @@ const GENERATED_DTS = 'components.d.ts'; | ||
} | ||
if (outputTarget.directivesProxyFile && !path.isAbsolute(outputTarget.directivesProxyFile)) { | ||
results.proxiesFile = normalizePath(path.join(config.rootDir, outputTarget.proxiesFile)); | ||
if (outputTarget.directivesProxyFile && !path__default['default'].isAbsolute(outputTarget.directivesProxyFile)) { | ||
results.proxiesFile = normalizePath(path__default['default'].join(config.rootDir, outputTarget.proxiesFile)); | ||
} | ||
@@ -261,0 +268,0 @@ return results; |
{ | ||
"name": "@stencil/vue-output-target", | ||
"version": "0.0.1-dev.11722471207.1c61e7f2", | ||
"version": "0.0.1-dev.11722540458.1506f4d7", | ||
"description": "Vue output target for @stencil/core components.", | ||
@@ -16,11 +16,11 @@ "main": "dist/index.cjs.js", | ||
"scripts": { | ||
"prepublishOnly": "pnpm run build", | ||
"prepublishOnly": "npm run build", | ||
"prebuild": "rimraf ./dist", | ||
"build": "tsc && pnpm run rollup", | ||
"build": "tsc && npm run rollup", | ||
"watch": "tsc --watch", | ||
"rollup": "rollup -c", | ||
"version": "pnpm run build", | ||
"prettier": "pnpm run prettier.base --write", | ||
"version": "npm run build", | ||
"prettier": "npm run prettier.base -- --write", | ||
"prettier.base": "prettier \"./({vue-component-lib,src,test,__tests__}/**/*.{ts,tsx,js,jsx})|*.{ts,tsx,js,jsx}\"", | ||
"prettier.dry-run": "pnpm run prettier.base --list-different", | ||
"prettier.dry-run": "npm run prettier.base -- --list-different", | ||
"release": "np", | ||
@@ -42,9 +42,2 @@ "test": "jest" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.0.0", | ||
"jest": "^27.0.0", | ||
"rimraf": "^5.0.0", | ||
"rollup": "^4.14.3", | ||
"typescript": "~5.0.0" | ||
}, | ||
"jest": { | ||
@@ -64,3 +57,6 @@ "transform": { | ||
}, | ||
"gitHead": "c61e7f25c6e404d060c297f70fd921de9b21b4cb" | ||
"gitHead": "506f4d72ba87a07be32c5e4d7724db362d7f9da6", | ||
"volta": { | ||
"extends": "../../package.json" | ||
} | ||
} |
@@ -188,2 +188,13 @@ // @ts-nocheck | ||
// If router link is defined, add href to props | ||
// in order to properly render an anchor tag inside | ||
// of components that should become activatable and | ||
// focusable with router link. | ||
if (props[ROUTER_LINK_VALUE] !== EMPTY_PROP) { | ||
propsToAdd = { | ||
...propsToAdd, | ||
href: props[ROUTER_LINK_VALUE], | ||
}; | ||
} | ||
/** | ||
@@ -190,0 +201,0 @@ * vModelDirective is only needed on components that support v-model. |
55182
0
1006