How to use the canonical-path.join function in canonical-path

To help you get started, we’ve selected a few canonical-path examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / angular / aio / tools / stackblitz-builder / builder.js View on Github external
build() {
    this._checkForOutdatedConfig();

    // When testing it sometimes helps to look a just one example directory like so:
    // var stackblitzPaths = path.join(this.basePath, '**/testing/*stackblitz.json');
    var stackblitzPaths = path.join(this.basePath, '**/*stackblitz.json');
    var fileNames = globby.sync(stackblitzPaths, { ignore: ['**/node_modules/**'] });
    fileNames.forEach((configFileName) => {
      try {
        // console.log('***'+configFileName)
        this._buildStackblitzFrom(configFileName);
      } catch (e) {
        console.log(e);
      }
    });
  }
github angular / dgeni / packages / angularjs / processors / examples-parse.js View on Github external
doc.content = doc.content.replace(EXAMPLE_REGEX, function processExample(match, attributeText, exampleText) {
        var example = extractAttributes(attributeText);
        example.files = extractFiles(exampleText);
        example.id = 'example-' + uniqueName(example.name || 'example');
        example.doc = doc;
        example.outputFolder = path.join(outputFolder, example.id);
        
        // store the example information for later
        examples.push(example);

        return generateExampleDirective(example);
      });
    });
github Famous / famous-angular / docs-generation / processors / create-folders.js View on Github external
create: function(config) {
		var currentVersion = config.get('currentVersion');

		var docsBase = path.join(config.get('basePath'), config.get('rendering.outputFolder'), 'docs');
		var versionDir = path.join(docsBase, currentVersion);

		// create the folders for the current version
		mkdirp.sync(versionDir);
	}
};
github ngrx / platform / projects / ngrx.io / tools / stackblitz-builder / builder.js View on Github external
_createPostData(config, configFileName) {
    var postData = {};

    // If `config.main` is specified, ensure that it points to an existing file.
    if (config.main && !this._existsSync(path.join(config.basePath, config.main))) {
      throw Error(`The main file ('${config.main}') specified in '${configFileName}' does not exist.`);
    }

    config.fileNames.forEach((fileName) => {
      var content;
      var extn = path.extname(fileName);
      if (extn == '.png') {
        content = this._encodeBase64(fileName);
        fileName = fileName.substr(0, fileName.length - 4) + '.base64.png'
      } else {
        content = fs.readFileSync(fileName, 'utf-8');
      }

      if (extn == '.js' || extn == '.ts' || extn == '.css') {
        content = content + this.copyrights.jsCss;
      } else if (extn == '.html') {
github ionic-team / ionic-v1 / config / docs / processors / latest-version.js View on Github external
mkdirp(versionDir, function() {
      copy(latestDir, path.join(versionDir, 'api'), {
        deleteFirst: true,
        overwrite: true
      }, function(err, files) {
        deferred.resolve(docs);
      });
    });
github nikhilmodak / gulp-ngdocs / index.js View on Github external
return vfs.src(src).pipe(through2.obj(function (file, enc, callback) {
      name = name === undefined ? path.normalize(file.path).split('/').pop() : name;
      this.push(new File({
        base: dest,
        cwd: dest,
        path: path.join(dest, dir, name),
        contents: file.contents
      }));
      callback(null);
    }));
  };
github angular / dgeni / packages / angularjs / processors / examples-generate.js View on Github external
function createFileDoc(example, file) {
  var fileDoc = {
    docType: 'example-' + file.type,
    id: example.id + '/' + file.name,
    template: path.join(templateFolder, 'template.' + file.type),
    file: example.doc.file,
    startingLine: example.doc.startingLine,
    example: example,
    path: file.name,
    outputPath: outputPath(example, file.name),
    fileContents: file.fileContents
  };
  return fileDoc;
}
github ionic-team / ionic-v1 / docs / docs.config.js View on Github external
config.set('logging.level', 'info');

  config.prepend('rendering.templateFolders', [
    path.resolve(__dirname, 'templates')
  ]);

  config.set('basePath', __dirname);
  config.set('source.projectPath', '.');
  config.set('rendering.outputFolder', '../temp/ionic-site');

  var versionData = require('./generate-versions')(config);
  config.set('versionData', versionData);
  config.set('rendering.contentsFolder', path.join('docs', versionData.current.folder));

  config.set('demos.outputFolder', path.join(__dirname, '../temp/ionic-demo'));

  config.set('processing.api-docs', {
    outputPath: 'api/${docType}/${name}/index.md',
    path: 'api/${docType}/${name}/',
    moduleOutputPath: 'api/module/${name}/index.md',
    modulePath: 'api/module/${name}/',
    mergeableTypes: {
      demo: 'demos'
    }
  });

  config.append('rendering.filters', [
    require('./filters/capital')
  ]);

  config.set('source.files', [
github angular / angular.js / docs / config / services / getVersion.js View on Github external
return function(component) {
    return require(path.join(sourceFolder, component, packageFile)).version;
  };
};
github dojo / widgets / src / examples / src / glob-examples.block.ts View on Github external
export default function() {
	const files = glob.sync(path.join(__dirname, 'widgets/**/*'), { nodir: true });
	const prefix = path.join(__dirname, 'widgets');
	return files.map((file) => file.replace(`${prefix}/`, ''));
}

canonical-path

paths that always use forward slashes

MIT
Latest version published 5 years ago

Package Health Score

50 / 100
Full package analysis