Giter Site home page Giter Site logo

netlify / build-plugin-template Goto Github PK

View Code? Open in Web Editor NEW
32.0 6.0 16.0 15.97 MB

Template repository to create new Netlify Build plugins.

License: MIT License

JavaScript 100.00%
netlify netlify-plugins continuous-integration continuous-deployment continuous-testing continuous-delivery ci build plugins shell

build-plugin-template's Introduction

Netlify Status

Template repository to create new Netlify Build plugins.

The main Build plugins documentation can be found here.

Initialization

To create a repository with a new Netlify Build plugin, click on the "Use this template" button on top of the page.

The repository name should start with netlify-plugin-, for example netlify-plugin-gatsby.

Clone the repository locally.

Inside the new repository directory, run the following command.

npm run init

Some questions will be asked. Make sure the plugin's name matches the repository name.

Among other things, this will replace this README.md with the plugin's user documentation. Development documentation will still be available in the CONTRIBUTING.md.

Finally, create a Netlify Site with the repository. This will automatically run your Build plugins in Netlify Build on every git push, as a smoke test.

You can also add a Netlify status badge.

Usage

The plugin's logic should be added to ./src/index.js. Comments in that file will guide you through the creation of a Build plugin.

Development tasks

The following development tasks are available. Please check the package.json scripts property for more information.

npm run build

Runs a Netlify Build locally with the current plugin. This can be used for debugging and manual tests.

The local Build configuration file is netlify.toml and can be modified.

npm run ava

Runs unit tests.

npm run lint

Lints and prettifies source files.

npm test

Runs both unit tests and linting.

npm run release

Publishes this plugin to npm.

build-plugin-template's People

Contributors

dependabot[bot] avatar ehmicky avatar erezrokah avatar ericapisani avatar netlify-bot avatar renovate-bot avatar renovate[bot] avatar siakaramalegos avatar tzmanics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

build-plugin-template's Issues

[security] Enforce Branch Protections

This is an issue generated by (for-internal-use-only)github-tools

Description

This repository has exceeded the development grace period, and the repo owner must decide if branch protections should be enforced.
If this repository houses code used in production in any capacity, branch protections must be enforced. Read (for-internal-use-only)here for more details

What do I need to do?

  • You can control whether or not branch protections are enforced by exclusively creating either of the labels:
    'enforce-branch-protections: true' or 'enforce-branch-protections: false'
  • If there is no branch protection control label, this issue will be recreated.
  • Once you have created either label, you can close this issue.
  • If you have issues or questions, please reach out to #internal-security-n-compliance on slack.

Adds TypeScript logic.

Now that TypeScript is allowed for Build plugins, we should:

  • Add an index.ts replicating what index.js does, but for TypeScript users
  • Do the same with test/index.ts
  • Add some information in README.md that this repository includes files for either JavaScript or TypeScript users
  • Update init/** to generate a TypeScript setup

Setup failures

Describe the bug

npm run init failed after prompts

? Source code repository DavidWells/netlify-plugin-next
? Supported Node.js version >=8.3.0
removed 11 packages in 4.669s

  ✖ Netlify Build should not fail Rejected promise returned by test

  1 test failed

  Netlify Build should not fail

  /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/node_modules/execa/lib/error.js:58

  Rejected promise returned by test. Reason:

  Error {
    command: 'netlify-build --config /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/test/../netlify.toml',
    exitCode: 1,
    failed: true,
    isCanceled: false,
    killed: false,
    shortMessage: 'Command failed with exit code 1: netlify-build --config /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/test/../netlify.toml',
    signal: undefined,
    signalDescription: undefined,
    stderr: '',
    stdout: `​␊
    ┌─────────────────────────────┐␊
    │        Netlify Build        │␊
    └─────────────────────────────┘␊
    ​␊
    ❯ Version␊
      @netlify/build 1.0.6␊
    ​␊
    ❯ Flags␊
      config: /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/test/../netlify.toml␊
    ​␊
    ❯ Current directory␊
      /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next␊
    ​␊
    ❯ Config file␊
      /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/netlify.toml␊
    ​␊
    ❯ Context␊
      production␊
    ​␊
    ┌─────────────────────────────┐␊
    │  Plugin "." internal error  │␊
    └─────────────────────────────┘␊
    ​␊
      Error message␊
      Error: This plugin is missing a "manifest.yml".␊
      Please see the documentation at https://github.com/netlify/build#anatomy-of-a-plugin␊
    ​␊
      Error location␊
      While loading "." from netlify.toml␊
          at async Promise.all (index 0)␊
    ​␊
      Resolved config␊
      build:␊
        command: echo onBuild␊
      plugins:␊
        - inputs: {}␊
          origin: config␊
          package: .`,
    timedOut: false,
    message: `Command failed with exit code 1: netlify-build --config /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/test/../netlify.toml␊
    ​␊
    ┌─────────────────────────────┐␊
    │        Netlify Build        │␊
    └─────────────────────────────┘␊
    ​␊
    ❯ Version␊
      @netlify/build 1.0.6␊
    ​␊
    ❯ Flags␊
      config: /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/test/../netlify.toml␊
    ​␊
    ❯ Current directory␊
      /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next␊
    ​␊
    ❯ Config file␊
      /Users/davidwells/Netlify/projects/next-research/netlify-plugin-next/netlify.toml␊
    ​␊
    ❯ Context␊
      production␊
    ​␊
    ┌─────────────────────────────┐␊
    │  Plugin "." internal error  │␊
    └─────────────────────────────┘␊
    ​␊
      Error message␊
      Error: This plugin is missing a "manifest.yml".␊
      Please see the documentation at https://github.com/netlify/build#anatomy-of-a-plugin␊
    ​␊
      Error location␊
      While loading "." from netlify.toml␊
          at async Promise.all (index 0)␊
    ​␊
      Resolved config␊
      build:␊
        command: echo onBuild␊
      plugins:␊
        - inputs: {}␊
          origin: config␊
          package: .`,
  }

  makeError (node_modules/execa/lib/error.js:58:11)
  handlePromise (node_modules/execa/index.js:114:26)

Error: Initialization failed.
added 11 packages from 5 contributors in 4.986s
Error: Test run failed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] init: `npm install --loglevel error --no-audit --no-fund && node init/bin.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] init script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/davidwells/.npm/_logs/2020-07-13T17_41_54_269Z-debug.log
➜  netlify-plugin-next git:(master)

Steps to reproduce

Step-by-step instructions on how to reproduce the behavior.

  1. Clone repo
  2. Run npm run init

Duplicate pull request template files

Describe the bug

The repository contains two pull request templates: .github/PULL_REQUEST_TEMPLATE.md and .github/pull_request_template.md. As they share the same name (capitalization aside), this also causes issues on case-insensitive filesystems.

Can you submit a pull request? Yes

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency eslint-plugin-n to v17
  • chore(deps): update dependency execa to v8
  • chore(deps): update dependency filter-obj to v6
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency release-it to v17
  • chore(deps): update dependency username to v7
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @netlify/build ^26.5.3
  • ava ^4.0.0
  • chalk ^5.0.0
  • cpy ^9.0.0
  • cross-env ^7.0.2
  • del ^6.0.0
  • email-validator ^2.0.4
  • eslint ^7.10.0
  • eslint-config-prettier ^8.0.0
  • eslint-plugin-import ^2.22.1
  • eslint-plugin-n ^14.0.0
  • eslint-plugin-prettier ^4.0.0
  • execa ^6.0.0
  • fast-glob ^3.2.4
  • filter-obj ^3.0.0
  • fuzzy ^0.1.3
  • git-remote-origin-url ^4.0.0
  • inquirer ^8.0.0
  • inquirer-autocomplete-prompt ^2.0.0
  • netlify-cli ^9.16.2
  • omit.js ^2.0.2
  • prettier ^2.1.2
  • release-it ^15.0.0
  • semver ^7.3.2
  • spdx-license-list ^6.3.0
  • strip-ansi ^7.0.0
  • username ^6.0.0
  • yargs ^17.0.0
  • node ^14.14.0 || >=16.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.