OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 56 forks source link

Fixed TS 2.8 namespace default export error #84

Closed casieber closed 6 years ago

casieber commented 6 years ago

Typescript 2.8 errors when trying to export a default from a namespace. Exploring the impact of moving completely away from namespaces and into module might take reaching out to a few people, so I figured a solid quick fix would be to simply move the default export to a named export.

Fixes #82 Fixes #79

mhzer commented 6 years ago

I am still getting this error on the latest npm release (1.0.2). Can I expect this change to be merged soon or should I ship my own version as a workaround?

Zlatkovsky commented 6 years ago

Adding Louis and Sudhi who can help follow up on the deployment status

sumurthy commented 6 years ago

Sorry for the delay. We're facing some technical issue in publishing the latest package. We're working on fixing it and will soon publish a new patch version.

davemurphysf commented 5 years ago

@sumurthy any update on pushing a new release?

jpenc commented 5 years ago

In the meantime you can help yourselves by fixing the one line with a postbuild script. In Angular you can do this e.g. by creating a patch.js file with the following content:

const fs = require('fs');
const f = 'node_modules/@microsoft/office-js-helpers/dist/office.helpers.d.ts';

fs.readFile(f, 'utf8', function (err,data) {
  if (err) {
    return console.log(err);
  }

  var result = data.replace('export default function stringify', 'export function stringify');

  fs.writeFile(f, result, 'utf8', function (err) {
    if (err)  {
      return console.log(err);
    }
  });
});

and then include it in angular.json in the scripts section: "postinstall": "node patch.js"