Giter Site home page Giter Site logo

polkadot-js / dev Goto Github PK

View Code? Open in Web Editor NEW
43.0 4.0 22.0 26.54 MB

Development configuration, scripts and and CI setup for polkadot-js projects. It acts as templates for other projects to reduce boilerplate, making everything consistent.

License: Apache License 2.0

JavaScript 74.51% Shell 1.65% TypeScript 23.78% Rust 0.06%
polkadot substrate polkadot-js config blockchain

dev's Introduction

@polkadot/dev

A collection of shared CI scripts and development environment (configuration, dependencies) used by all @polkadot projects.

Included here -

dev's People

Contributors

alexzhenwang avatar amaury1093 avatar axelchalon avatar ekowalsk avatar fend25 avatar github-actions[bot] avatar greenkeeper[bot] avatar jacogr avatar nazar-pc avatar stefansarya avatar stefie avatar tarikgul avatar wirednkod 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dev's Issues

Support flatenned workspaces

Currently the build scrips looks in packages/* to build (same with lint, etc). It would be great if packages in the root can be detected and built. Effectively this logic needs to change -

https://github.com/polkadot-js/dev/blob/master/packages/dev/scripts/polkadot-dev-build-babel.sh#L51

(In this repo itself, it would mean that dev and dev-react can be on the root, instead of nested under packages/)

Additionally, it would make sense to have a "lint script" (and possibly "test script") that can take these into account when running the operations.

Upgrade to typescript-eslint 2.0

config should end up looking something like -

const base = require('@polkadot/dev-react/config/eslint');

module.exports = {
  ...base,
  parserOptions: {
    ...base.parserOptions,
    project: [
      './tsconfig.json'
    ]
  }
};

However cannot quite get it right, this config doesn't do the trick -

{
  "extends": "./packages/dev/config/tsconfig",
  "include": [
    "packages/**/*.ts",
    "packages/**/*.tsx",
    "./packages/**/*.js"
  ],
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
    },
    "typeRoots": [
      "./node_modules/@types"
    ]
  }
}

`@polkadot/*` packages should be published in topological order

As a result of polkadot-js/api#5841 we learned that the CI that publishes a new release for @polkadot/api, doesn't publish the packages in topological order. Instead, it seems to first publish the @polkadot/api package and then it starts publishing its dependencies.

For instance, version @polkadot/[email protected] was published at 19/03/204, 14:22:35:

image

and version @polkadot/[email protected] was published 21 seconds earlier:

image

That means that for a span of 21 seconds the package @polkadot/api was "broken". This is obviously not a big deal when the release works, because if you are so unlucky to install the package during that short span of time, once you retry then everything works... However, if there is an issue during the release process (like what it happened on polkadot-js/api#5841), then the release stays broken for hours, and that is a lot more annoying to deal with.

On the other hand, if @polkadot/api-augment had been published before, and then the release halts for some reason, then that can't hurt anyone.

Add build-output lint step

Basically in some weird cases (we had one about a year ago in the API) and then again today polkadot-js/common#1225 TS generates code that contains .../<somewhere>/src/<something> imports.

So basically, as a sanity check one we went through the build, just check the generated *.cjs., *.js & *.d.ts files for occurences of /src/. Like a post-build linting step.

Remove yarn requirement

It states in this package that

Currently only
        yarn supports package.json workspaces, hence the limitation.

This is now false as npm has very reasonable workspaces support. This check prevents local installation of polkadotJS packages when using npm workspaces.

e.g

  • polkadotJS is in /usr/pjs and has been built using yarn build
  • npm workspace is in /usr/wrk
  • polkadotJS deps are referenced in /usr/wrk package.json like "@polkadot/api: file:../pjs"

Better handling of empty directory

When the content of a directory is removed, git doesn't remove the directory automatically.
But the build scripts traverse all the package directory and attempt to build all of them, and fail on the empty one. It should print a warning and not fail if the package directory is empty, because it was removed or renamed.

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.