Coder Social home page Coder Social logo

microsoft / rushstack Goto Github PK

View Code? Open in Web Editor NEW
5.6K 52.0 581.0 151.79 MB

Monorepo for tools developed by the Rush Stack community

Home Page: https://rushstack.io/

License: Other

JavaScript 3.49% TypeScript 96.15% CSS 0.03% Batchfile 0.02% Shell 0.06% HTML 0.05% Sass 0.03% SCSS 0.17%
monorepo rush typescript api api-extractor build toolchain nodejs eslint orchestrator

rushstack's Issues

[web-library-build] Sourcemaps do not map to typescript sources

This issue is regarding to the web-library-build package version 3.2.8.

When using web-library-build with no customization, the bundle task creates sourcemaps that map to compiled js-files in lib folder instead of their original typescript sources.

The default project layout is:
dist/
lib/
src/

As far as I can understand, the bundle task uses the build task to compile typescript files and corresponding sourcemaps to the lib-folder. Then the webpack task bundles these compiled js-files to a bundle in the dist-folder together with a sourcemap file. However this sourcemap file does not map to the original typescript sources - it only maps to the js-files in lib-folder.

Is there a way to enable the correct mapping?

[load-themed-styles] Error in function shouldUseCssText

There's a error in @microsoft\load-themed-styles.

The function shouldUseCssText() is used to determine wether registerStyles() or registerStylesIE() is used to register styles. According to shouldUseCssText(), registerStylesIE() should be used for IE 9 and below, but it also kicks in for IE 10 and IE 11 (which default to document mode IE 10).

Could shouldUseCssText() be written in another way?

Feature Request: Link Subdirectory

Most of my libraries create their output in a separate folder /dist including a separate package.json file. Published npm package will contain content of this /dist folder only, so I'd prefer to link only this /dist folder. That seems to be not possible.

Example:

// rush.json
{
  "projects": [
    {
      "packageName": "mylib",
      "projectFolder": "mylib",
      "distFolder": "mylib/dist"
    }],
   ...
}

And in "myapp":

/node_modules/mylib/ <contents from mylib/dist>

Missing package from wiki: ts-spec-gen

I found in api-extractor wiki link to a package, which repository is not found.

For each project, API Extractor also outputs a JSON file that is used to generate online documentation. Our online documentation looks like this. It is produced by a pipeline:

api-extractor --> sp-core-library.api.json --> ts-spec-gen --> sp-core-library.md --> custom markdown template --> HTML output

Link to wiki

Is this package still available somewhere? I think it would actually help a lot for documentation generation from json file.

tslint task failing

I have a rather simple project using rush (3.0.12) and "@microsoft/web-library-build": "^3.2.3".

I configured the tslint gulp task as"

//Configure custom lint overrides. let rules = Object.assign( {}, require('./tslint.json').rules ); build.tslint.setConfig({ lintConfig: { rules }, displayAsWarning: false });

and the rush (re)build ot gulp tslint are failing with:

FatalError in plugin 'gulp-cache'
Message:
Invalid source file: C:\ossiaco\etorrent\packages\core-strings\src\index.ts. Ensure that the files supplied to lint have a .ts, .tsx, .d.ts, .js or .jsx extension.
Details:
innerError: undefined

Running "tslint -p ." from the command line works fine

I'm at a loss for why it's failing.

thanks
rich

rush: "unable to hash" when using git submodules

I've a few npm packages currently in one git repository per npm package. For testing I created a new git repository and added the existing projects using git submodules.
When I run "rush rebuild" I get the following error:

> Starting task [@40three/ng-data]
fatal: Unable to hash ng-base

Where "ng-base" is the folder of a project added as git submodule.
Running "rush rebuild --verbose" reports:

Unable to calculate incremental build state. Instead running full rebuild. Error: Command failed: git hash-object .gitignore README.md common/config/rush/npm-shrinkwrap.json ng-base ng-data rush.json

(Submodules: ng-base and ng-data folder.)

I guess it's getPackageDeps.ts where it seems that all modified files as returned by git should be hashed but git status returns these two directories too because they're submodules.

Executing serve build command exits gulp process - server stops running

Hello,
I tried running the gulp command(s) from the wiki page, but have an issue with the @microsoft/gulp-core-build-serve part.

Running gulp serve fires up a server, opens up the browser, loads the page correctly, but then exists the process, causing the http server to stop.

Could you please guide me towards a solution?

Here's the output of the gulp command:

C:\Projects\_Testing\wp-framework-vscode> gulp serve
[17:03:37] Using gulpfile C:\Projects\_Testing\wp-framework-vscode\gulpfile.js
[17:03:37] Starting gulp
[17:03:37] Starting 'serve'...
[17:03:37] Starting subtask 'typescript'...
[17:03:37] [typescript] TypeScript version: 2.1.6
[17:03:37] Starting subtask 'sass'...
[17:03:38] Finished subtask 'sass' after 569 ms
[17:03:39] Finished subtask 'typescript' after 2.26 s
[17:03:39] Starting subtask 'webpack'...
[17:03:40] Finished subtask 'webpack' after 804 ms
[17:03:40] Starting subtask 'serve'...
[17:03:40] Finished subtask 'serve' after 156 ms
[17:03:40] Finished 'serve' after 3.23 s
[17:03:40] Server started http://localhost:4321
[17:03:40] LiveReload started on port 35729
[17:03:40] Opening http://localhost:4321/index.html using the default OS app
  Request: '/index.html'
  Request: '/node_modules/react/dist/react.js'
  Request: '/node_modules/react-dom/dist/react-dom.js'
  Request: '/dist/helloWorld.js'
  Request: '/dist/myOther.js'
[17:03:41] ==================[ Finished ]==================
[17:03:41] Project wp-framework version: 1.0.0
[17:03:41] Build tools version: 2.4.0
[17:03:41] Node version: v6.9.1
[17:03:41] Total duration: 5.12 s

Thank you in advance,
Nick

RushCommandLineParser Error

Since Version 3.0.8 (also 3.0.9)

When launching rush generate, it returns the following error

Error: The command failed with exit code 1

at ProjectBuildTask._executeTask (/usr/local/lib/node_modules/@microsoft/rush/lib/taskRunner/ProjectBuildTask.js:88:31)
at /usr/local/lib/node_modules/@microsoft/rush/lib/taskRunner/ProjectBuildTask.js:31:19
at ProjectBuildTask.execute (/usr/local/lib/node_modules/@microsoft/rush/lib/taskRunner/ProjectBuildTask.js:28:16)
at _loop_1 (/usr/local/lib/node_modules/@microsoft/rush/lib/taskRunner/TaskRunner.js:144:18)
at TaskRunner._startAvailableTasks (/usr/local/lib/node_modules/@microsoft/rush/lib/taskRunner/TaskRunner.js:176:13)
at /usr/local/lib/node_modules/@microsoft/rush/lib/taskRunner/TaskRunner.js:97:19
at TaskRunner.execute (/usr/local/lib/node_modules/@microsoft/rush/lib/taskRunner/TaskRunner.js:96:16)
at RebuildAction.onExecute (/usr/local/lib/node_modules/@microsoft/rush/lib/actions/RebuildAction.js:108:20)
at RebuildAction.CommandLineAction.execute (/usr/local/lib/node_modules/@microsoft/rush/node_modules/@microsoft/ts-command-line/lib/CommandLineAction.js:40:14)
at RushCommandLineParser.CommandLineParser.onExecute (/usr/local/lib/node_modules/@microsoft/rush/node_modules/@microsoft/ts-command-line/lib/CommandLineParser.js:90:27)

Instead this error is not reproducible with 3.0.7

[api-extractor] Functions and Methods doesn't get their params

I started writing my own docs generating implementation and encountered some issues with api-extractor module.

Functions doesn't get its parameters because object is undefined. Source code: here and here

Example:

/**
 * Sum summary
 * @public
 * @returns Return summary.
 */
export function Sum(a: number, b: number): number {
    return a + b;
}

JSON output:

{
    "Sum": {
        "kind": "function",
        "returnValue": {
            "type": "number",
            "description": [{
                "kind": "textDocElement",
                "value": "Return summary."
            }]
        },
        "parameters": {},
        "deprecatedMessage": [],
        "summary": [{
            "kind": "textDocElement",
            "value": "Sum summary"
        }],
        "remarks": [],
        "isBeta": false
    }
}

I fixed quickly with this:

const parameters: { [key: string]: IParam } = {};

for (const param of apiFunction.params) {
    // FIXME: any
    parameters[param.name] = {} as any;

    this.visitApiParam(param, parameters[param.name]);
}

Can't install the package by command "npm install @microsoft/node-core-library"

Error message is,
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm
\bin\npm-cli.js" "install" "@microsoft/node-core-library"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code E404

npm ERR! 404 Not found : @microsoft/node-core-library
npm ERR! 404
npm ERR! 404 '@microsoft/node-core-library' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! E:\spfx\githubdemos\GDPR\sp-dev-gdpr-activity-hub\GDPRStarterKit\npm-debug.log

Debug information in npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files (x86)\nodejs\node.exe',
1 verbose cli 'C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '@microsoft/node-core-library' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData @microsoft/node-core-library
8 silly fetchNamedPackageData @microsoft/node-core-library
9 silly mapToRegistry name @microsoft/node-core-library
10 silly mapToRegistry scope (from package name) @microsoft
11 verbose mapToRegistry no registry URL found in name for scope @microsoft
12 silly mapToRegistry using default registry
13 silly mapToRegistry registry https://registry.npmjs.org/
14 silly mapToRegistry data Result {
14 silly mapToRegistry raw: '@microsoft/node-core-library',
14 silly mapToRegistry scope: '@microsoft',
14 silly mapToRegistry escapedName: '@microsoft%2fnode-core-library',
14 silly mapToRegistry name: '@microsoft/node-core-library',
14 silly mapToRegistry rawSpec: '',
14 silly mapToRegistry spec: 'latest',
14 silly mapToRegistry type: 'tag' }
15 silly mapToRegistry uri https://registry.npmjs.org/@microsoft%2fnode-core-library
16 verbose request uri https://registry.npmjs.org/@microsoft%2fnode-core-library
17 verbose request no auth needed
18 info attempt registry request try #1 at 17:22:02
19 verbose request id 4890c9ce289e249f
20 http request GET https://registry.npmjs.org/@microsoft%2fnode-core-library
21 http 404 https://registry.npmjs.org/@microsoft%2fnode-core-library
22 verbose headers { 'content-type': 'application/json',
22 verbose headers 'cache-control': 'max-age=0',
22 verbose headers 'content-length': '21',
22 verbose headers 'accept-ranges': 'bytes',
22 verbose headers date: 'Wed, 30 Aug 2017 09:22:03 GMT',
22 verbose headers via: '1.1 varnish',
22 verbose headers age: '0',
22 verbose headers connection: 'keep-alive',
22 verbose headers 'x-served-by': 'cache-nrt6132-NRT',
22 verbose headers 'x-cache': 'MISS',
22 verbose headers 'x-cache-hits': '0',
22 verbose headers 'x-timer': 'S1504084924.598008,VS0,VE132' }
23 silly get cb [ 404,
23 silly get { 'content-type': 'application/json',
23 silly get 'cache-control': 'max-age=0',
23 silly get 'content-length': '21',
23 silly get 'accept-ranges': 'bytes',
23 silly get date: 'Wed, 30 Aug 2017 09:22:03 GMT',
23 silly get via: '1.1 varnish',
23 silly get age: '0',
23 silly get connection: 'keep-alive',
23 silly get 'x-served-by': 'cache-nrt6132-NRT',
23 silly get 'x-cache': 'MISS',
23 silly get 'x-cache-hits': '0',
23 silly get 'x-timer': 'S1504084924.598008,VS0,VE132' } ]
24 silly fetchPackageMetaData Error: Not found : @microsoft/node-core-library
24 silly fetchPackageMetaData at makeError (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:302:12)
24 silly fetchPackageMetaData at CachingRegistryClient. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:290:14)
24 silly fetchPackageMetaData at Request._callback (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:210:14)
24 silly fetchPackageMetaData at Request.self.callback (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:187:22)
24 silly fetchPackageMetaData at emitTwo (events.js:106:13)
24 silly fetchPackageMetaData at Request.emit (events.js:191:7)
24 silly fetchPackageMetaData at Request. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:1048:10)
24 silly fetchPackageMetaData at emitOne (events.js:96:13)
24 silly fetchPackageMetaData at Request.emit (events.js:188:7)
24 silly fetchPackageMetaData at IncomingMessage. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:969:12)
24 silly fetchPackageMetaData error for @microsoft/node-core-library { Error: Not found : @microsoft/node-core-library
24 silly fetchPackageMetaData at makeError (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:302:12)
24 silly fetchPackageMetaData at CachingRegistryClient. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:290:14)
24 silly fetchPackageMetaData at Request._callback (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:210:14)
24 silly fetchPackageMetaData at Request.self.callback (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:187:22)
24 silly fetchPackageMetaData at emitTwo (events.js:106:13)
24 silly fetchPackageMetaData at Request.emit (events.js:191:7)
24 silly fetchPackageMetaData at Request. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:1048:10)
24 silly fetchPackageMetaData at emitOne (events.js:96:13)
24 silly fetchPackageMetaData at Request.emit (events.js:188:7)
24 silly fetchPackageMetaData at IncomingMessage. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:969:12)
24 silly fetchPackageMetaData pkgid: '@microsoft/node-core-library',
24 silly fetchPackageMetaData statusCode: 404,
24 silly fetchPackageMetaData code: 'E404' }
25 silly rollbackFailedOptional Starting
26 silly rollbackFailedOptional Finishing
27 silly runTopLevelLifecycles Finishing
28 silly install printInstalled
29 verbose stack Error: Not found : @microsoft/node-core-library
29 verbose stack at makeError (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:302:12)
29 verbose stack at CachingRegistryClient. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:290:14)
29 verbose stack at Request._callback (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:210:14)
29 verbose stack at Request.self.callback (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:187:22)
29 verbose stack at emitTwo (events.js:106:13)
29 verbose stack at Request.emit (events.js:191:7)
29 verbose stack at Request. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:1048:10)
29 verbose stack at emitOne (events.js:96:13)
29 verbose stack at Request.emit (events.js:188:7)
29 verbose stack at IncomingMessage. (C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:969:12)
30 verbose statusCode 404
31 verbose pkgid @microsoft/node-core-library
32 verbose cwd E:\spfx\githubdemos\GDPR\sp-dev-gdpr-activity-hub\GDPRStarterKit
33 error Windows_NT 6.3.9600
34 error argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Users\abrcheng\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "@microsoft/node-core-library"
35 error node v6.11.1
36 error npm v3.10.10
37 error code E404
38 error 404 Not found : @microsoft/node-core-library
39 error 404
40 error 404 '@microsoft/node-core-library' is not in the npm registry.
41 error 404 You should bug the author to publish it (or use the name yourself!)
42 error 404 Note that you can also install from a
43 error 404 tarball, folder, http url, or git url.
44 verbose exit [ 1, true ]

With [email protected], task construction fails

Calling new on a custom task that extends GulpTask fails with this error

TypeError: Class constructor GulpTask cannot be invoked without 'new'
    at new ResxToTsTask (C:\Users\alebet\git\pexweb6\packages\pextasks\lib\gulpTasks\ResxToTsTask.js:23:23)
    at Object.<anonymous> (C:\Users\alebet\git\pexweb6\packages\pexui\gulpfile.js:50:15)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Liftoff.handleArguments (C:\Users\alebet\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:116:3)
    at Liftoff.<anonymous> (C:\Users\alebet\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js:198:16)
    at module.exports (C:\Users\alebet\AppData\Roaming\npm\node_modules\gulp\node_modules\flagged-respawn\index.js:17:3)
    at Liftoff.<anonymous> (C:\Users\alebet\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js:190:9)
    at C:\Users\alebet\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js:164:9
    at C:\Users\alebet\AppData\Roaming\npm\node_modules\gulp\node_modules\v8flags\index.js:110:14
    at C:\Users\alebet\AppData\Roaming\npm\node_modules\gulp\node_modules\v8flags\index.js:38:12

This was succeeding in earlier versions, only to fail in 3.1.0

[load-themed-styles] Styles not loading in IE11

I'm using @microsoft/gulp-core-build-sass in combination with @microsoft/loader-load-themed-styles to load my themed CSS in a webpack bundle.
This works fine 90% of the time, but:

  • in chrome sometimes (+/- 5% of the time) the CSS is not loaded. when selecting a DOM node in dev tools, no classes are attached to the element, and indeed, in the HTML the custom css's <style> tag is nowhere to be found.
  • in IE11, with document mode set to IE11 the CSS is never loaded. Same issue here in dev tools.
  • in IE11, with document mode set to IE10, I have not seen any issues. Granted - the amount of tries have been limited.

So, it seems that the loadStyles function is called too soon, which results in the css not being loaded on the page.

If anyone could point me in the right direction as to why this occurs, it'd be very helpful!

PS: the outputted webpack bundles are used on a SharePoint Online publishing page.

[api-extractor] Missing specific kind property string in IDocElement.

Specific "kind" property is missing in interfaces.
IHrefLinkElement and ICodeLinkElement should have kind: 'linkDocElement';.
Because this string is used: here and here.

That will provide type checking in links mentioned above, moreover type gates would work:

switch (item.kind) {
    case "textDocElement": {
        return textElement.value;
    }
    case "linkDocElement": {
        switch (item.referenceType) {
            case "href": {
                // Do something about href
            }
            case "code": {
                // Do something about code
            }
        }
    }
}

In gcb-sass, we should rename useCSSmodules

The name is confusing, since we treat anything with .module.scss as a css module, regardless of whether this flag is on. When this flag is on, we treat all .scss as a module, so I propose a rename to:

treatAllFilesAsCSSModules

Karma extensibility for reporters

Is it possible to include extensibility for using additional reporters like for example: karma-html-reporter?

This makes our unit-tests a lot better and easier to report.

rush rebuild -q Error: spawn ENAMETOOLONG

hi
I'm using rush for angular2 - webpack (https://github.com/AngularClass/angular2-webpack-starter)

rush generate
and
rush link
throw no error
but
rush rebuild -q


> Starting task [components]
> Starting task [elearning]
internal/child_process.js:313
    throw errnoException(err, 'spawn');
    ^

Error: spawn ENAMETOOLONG
    at exports._errnoException (util.js:1022:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.execFile (child_process.js:143:15)
    at Object.exports.exec (child_process.js:103:18)
    at C:\Users\admin\AppData\Roaming\npm\node_modules\@microsoft\rush\node_modules\@microsoft\package-deps-hash\lib\get
PackageDeps.js:45:35
    at ChildProcess.exithandler (child_process.js:213:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)

[api-extractor] ApiStructuredType implements property should be string array.

Class implements should be string array, because you can implement more than one interface.

/**
 * @public
 */
export interface Foo {
    Name: string;
    Surname: string;
}

/**
 * @public
 */
export interface Foo2 {
    Name: string;
}

export class FancyFooBar<TValue = string> extends FooBar implements Foo, Foo2 {
    public Name: string;
    public Surname: string;
    public get Bar(): Bar {
        return this.LocalBar;
    }

    public ThatValue: TValue;
}

Class FancyFooBar implements property returns only Foo.

Source code

using the api config entry

Just trying to implement this and can't work out how.

In my gulpfile I created the following entry

build.serve.setConfig({
  initialPage: '/',
  api: {
    entryPath: 'api.js',
  }
});

and in my api.js had the following simple piece of code

let path = require('path');

export default function(req, res) {
    res.sendFile(path.join(__dirname+'/index.html'));
}

Can't work out what the entryPath needs to be. Have tried just 'api', './api' and those don't work either.

Any ideas or examples I can look at?

Cyclic Dependency Problems

I have some cyclic package dependencies that I want to put into place for a complex solution but the "rush generate" command fails.

To illustrate the problem I created a simple sample with projects a, b, & c, where b & c depend on a, and a on b & c.
sample.zip

I am getting:
npm ERR! code E404
npm ERR! 404 Not Found: proja@>=1.0.0 <2.0.0

the rush.json file is:

{
  // NOTE: Comments are allowed in all Rush config files :-)
  "npmVersion": "5.0.3",
  "rushMinimumVersion": "3.0.7",
  "nodeSupportedVersionRange": ">=6.9.0 <8.0.0",
  "projectFolderMinDepth": 1,
  "projectFolderMaxDepth": 999,
  "projects": [
    {
      "packageName": "proja",
      "projectFolder": "proja",
      "shouldPublish": true
    },
    {
      "packageName": "projb",
      "projectFolder": "projb",
      "shouldPublish": true,
      "cyclicDependencyProjects": [
        "proja"
      ]
    },
    {
      "packageName": "projc",
      "projectFolder": "projc",
      "shouldPublish": true,
      "cyclicDependencyProjects": [
        "proja"
      ]
    }
  ]
}

Any help is really appreciated as this a blocking issue (short of creating runtime import abstractions)

rich

Rush change: use the correct remote in github scenarios

I see empty change files in fabric-react nearly every day. Example:

https://github.com/OfficeDev/office-ui-fabric-react/pull/2514/files

This was because it’s comparing against “origin/master”, which is the wrong remote.

It’s not the end of the world, but it would really be nice to fix rush change to compare against the correct remote. This can be deduced a number of ways. For example, package.json has the repository details in there.

I have a really hard time explaining the “-b” parameter to people because I have no idea what the dev called their officedev remote, if they even made one. This is a really annoying issue that makes rush awkward to use in github scenarios where people normally fork the repo and work from the fork. Thankfully we can ignore the extra files, but I’m a little worried by comparing against the wrong remote we may miss a change.

Perf regression: moving from web-library-build 1.x.x to 2.x.x

I see when moving from WLB 1 to 2, typescript compilation slows down significantly on larger projects like office-ui-fabric-react. Compilation went from 19 seconds to 1.9 minutes.

Case in point:

Before: 18s
https://travis-ci.org/OfficeDev/office-ui-fabric-react/builds/208238790

After: 1.89min
https://travis-ci.org/OfficeDev/office-ui-fabric-react/builds/208326235

It doesn't seem to be related to typescript itself. Using the same build of typescript in each scenario.

It doesn't seem related to gulp-typescript. I tried just downgrading that specific thing by hacking in an older version into node_modules post rush link, still latency.

I tried downgrading gcb-typescript as well, still latency.

It might be something totally tangential that we're pulling into dependencies.

Tracking with an issue.

web-library-build: serve task no longer starts local http server

It seems that serve task in web-library-build no longer starts a local http server.

Normally, the command gulp serve compiles, bundles, starts the local http server and watches for changes, but now it seems that the server is not started at all.

Does the serve task now require additional configuration for actually serving?

[rush] "rush change" needs to detect where the rush.json file is relative to the git repo

Right now this causes issues if your rush.json is not in the root of your repository.

Essentially, rush change is using relative paths from git to determine which project a changed file belongs to, however, the rush.json has paths that are relative to its location, whereas git has paths that are relative to the root of the repo.

The fix for this should be relatively straightforward. Whenever we do Git-based operations, we should append the relative path to the rush.json file to the relativeFolderPath's for each project.

Most likely this also affects incremental build.

build.addSuppression support regex?

There were some warnings that will print local path (C:/Users/xxx/GitRepos/...) that variant in different machines.
If the addSuppression method can support regex, then we can filter these kinds of warning logs out and bypass the build.

[api-extractor] Namespace doesn't have exported members

Code sample:

/**
 * @public
 */
export namespace CoolStuff {
    /**
     * Yet another sum function.
     */
    export function YetAnotherSumFunc(x: number, y: number): number {
        return x + y;
    }

    export const a: string = "namespaced a";
}

Searching in the source code, I only found: ApiModuleVariable.

I think, api-extractor should support interfaces, enums, classes etc, in namespaces.

EDIT:

if (!(followedSymbol.flags === ts.SymbolFlags.BlockScopedVariable)) {
          this.reportWarning(`Unsupported export "${exportSymbol.name}" ` +
            'Currently the "namespace" block only supports constant variables.');
          continue;
}

Strangely enough, I haven't received a warning in api-extractor runtime.

[gcb] typescript task inlines content into sourcemaps

The typescript task inlines the file contents into the source maps with no way to override it.

By default gulp-sourcemaps includes the content when generating the files. Unfortunately, this is a problem when debugging node projects or chrome workspace mapped files because breakpoints are not recognized on the local files.

There needs to be a way to provide includeContent: false to gulp-sourcemaps

thanks,
rich

Rush: Can't get change/publish to work?

Hi,

rush version 3.0.11

Help! rush change always results in No change file is needed and rush publish doesn't seem do anything... even though we've changed loads of projects inside our monorepo.

Am I missing something (can't find anything in the docs)?

  • Our work-in-progress monorepo lives here if that helps.

One of the reasons for using Rush was to help take the sting out out of publishing, any help gratefully received!

Thanks

TypeScript 2.4

Hello, is there a plan/procedure to make the build use TypeScript 2.4 instead of 2.2.2?
gulp-core-build-typescript will always compile using 2.2.2 at the moment.

Thank you.

decouple from Gulp

I am looking into this tool to see if I can use it for my needs

I am working on this:
https://github.com/ORESoftware/npm-link-up

and I discovered Rush and Lerna in the process. One thing about Rush that threw me off - why is it so coupled with Gulp.js? I have seen some problems with Gulp over the years and it generally scares me. Seems like using Bash would have been a better move, but maybe I missing something.

[gcb] gulp-sourcemap differences

I have a config that includes the following:

build.typescript.taskConfig.libES6Dir = './es6';
build.typescript.taskConfig.libDir = './lib';

the problem is that the source maps point to 2 different locations.

lib pointing to:
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,uDAA6B;AAC7B,yDAA+B","file":"index.js","sourcesContent":["export * from \"./common/index\";\r\nexport * from \"./site/index\";\r\nexport * from \"./tenant/index\";\r\n"],"sourceRoot":"..\\src"}

and es6 pointing to:
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC","file":"index.js","sourcesContent":["export * from \"./common/index\";\r\nexport * from \"./site/index\";\r\nexport * from \"./tenant/index\";\r\n"],"sourceRoot":"..\\src"}

this is a real show stopper in trying to get node projects debugged with commonjs.

If I run the default tsc. I get
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,uDAA6B;AAC7B,yDAA+B"}

rich

[Rush] The NPM shrinkwrap file does not provide gulp.

Output:

$ rush install

Rush Multi-Package Build Tool 3.0.9 - http://aka.ms/rush


Starting "rush install"

Found NPM version 5.0.3 in C:\Users\QuatroDev\.rush\npm-5.0.3

Symlinking "D:\SimplrJS\simplr-forms\common\temp\npm-local"
  --> "C:\Users\QuatroDev\.rush\npm-5.0.3"

Updating temp projects in D:\SimplrJS\simplr-forms\common\temp\projects

The NPM shrinkwrap file does not provide "gulp" (github:gulpjs/gulp#4.0) required by pinned versions
Updating D:\SimplrJS\simplr-forms\common\temp\npm-shrinkwrap.json

The NPM shrinkwrap file is missing "gulp" (github:gulpjs/gulp#4.0) required by "@simplr/react-forms".

The NPM shrinkwrap file is missing "gulp" (github:gulpjs/gulp#4.0) required by "@simplr/react-forms-dom".

The NPM shrinkwrap file is missing "gulp" (github:gulpjs/gulp#4.0) required by "@simplr/react-forms-validation".

You need to run "rush generate" to update your NPM shrinkwrap file.

I ran into problem when using dependency from github at specific tag in my packages.

    "gulp": "github:gulpjs/gulp#4.0",

From npm-shrinkwrap.json:

    "gulp": {
      "version": "github:gulpjs/gulp#38246c3f8b6dbb8d4ef657183e92d90c8299e22f",

It takes last commit hash from 4.0 branch.

gcb-typescript: support for tsconfig extends

The extends feature allows a tsconfig.json file to inherit configurations from another file. This is particularly useful when using rush and maintaining multiple packages in a monorepo.

gulp-typescript just added support for tslint extends in its latest release.

I believe there is no additional work for gcb-typescript other than start consuming the latest version of gulp-typescript.

Project dependencies

It's not at all clear how to get project dependencies to work.

If I create ProjextA and ProjectB (dependency of A) at the same time how do I get B linked to A?
Adding B to the project.json of A result in "rush generate" failing and "cyclicDependencyProjects" in rush.json does not seem to have any effect.

thanks,
rich

Feature Request - inline-mage in sass-task

I really need the ability to inline images into the compiled css. If I use a standard node-sass task I can inline svg files using the approach described here.

Based on the code for the build tools sass task, it should be pretty straight forward to implement.

thanks.
rich

Outdated link

The link pointed to rush-schema.json in wiki is outdated. The file now is named rush.schema.json and located in https://github.com/Microsoft/web-build-tools/blob/master/apps/rush-lib/src/rush.schema.json.

[gulp-core-build] Set/replace SASS variables in gulp

Is it possible in any way to change SASS variables at compile time?

Specifically, I need to change relative IMG base paths.
E.g: I have images in a SharePoint /Style Library. However, since gulp-core-build-sass injects the output CSS as JS, the relative paths do not work anymore. This could be resolved/worked around if I could specify an absolute path when running gulp.

Thanks.

[rush] "rush build" always rebuilds a project with an empty build script

Repro:

Have 2 or more packages in a repo that depend on a core package.
In the core package, have an empty string for clean/build scripts:

{
  "scripts": {
    "clean": "",
    "build": ""
  }
}

Run rush build
Run rush build again

Expected:
Everything is skipped.

Resulted:
Everything is built again, because an empty "build" script bypasses the build task completely and invalidates downstream dependencies.

Error when start "gulp serve"

What I did:

  1. "npm install" on a spfx sample project (https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/js-display-list)
  2. Try to make it run with "gulp serve".

The error I get:

E:\dev\admboehnma\ttt\js-display-list>gulp serve
Build target: DEBUG
TypeError: Cannot read property 'readCommentedJsonFile' of undefined
TypeError: Cannot read property 'readCommentedJsonFile' of undefined
[12:59:01] Error - Unknown
undefined
[12:59:02] ==================[ Finished ]==================
[12:59:02] Project js-display-list version: 0.0.2
[12:59:02] Build tools version: 2.10.0
[12:59:02] Node version: v6.11.2
[12:59:02] Total duration: 4.08 s
[12:59:02] Task errors: 2

The problem is new. The day before yesterday this worked without any issues.

Thanks for help!

Can't disable sass warning "filename should end with module.scss"

Hi,

i am using the web-build-tools in a SPFx project. Then i added a test.scss file, so that no hashes are added to the classes i am using. In the gulp task there is now a warning displayed:

Warning - [sass] src\webparts\utilities\circleProgress.scss: filename should end with module.scss

I've tried to disable this warning by setting the config for the build task. But the default sass config is warnOnNonCSSModules: false. My Build Task looks like the following:

const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
console.log(build.sass.taskConfig);
build.sass.setConfig({ warnOnNonCSSModules: false, useCssModules:true});
build.initialize(gulp);

In the console there is the following output:

{ preamble: '/* tslint:disable */',
  postamble: '/* tslint:enable */',
  sassMatch: [ 'src/**/*.scss' ],
  useCSSModules: false,
  warnOnCssInvalidPropertyName: true,
  dropCssFiles: false,
  warnOnNonCSSModules: false }

How can i achieve to hide the warning? Am i using the wrong property?

I am using the SP-Build-Web 1.1.0.

Thanks

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.