Giter Club home page Giter Club logo

Comments (6)

eromano avatar eromano commented on August 21, 2024

Ts file should not be present I agree, I will give it a look

from alfresco-js-api.

garth avatar garth commented on August 21, 2024

Just tested with v4.4.0 and the package types are still broken. Since this is a critical blocking issue, but easy to fix (see #1110), we will republish until there is an official fix.

Update: In case someone else is having typescript errors with v4.4.0, this version has the necessary fix. If you are not having typescript issues, please use the official version.

from alfresco-js-api.

Den-dp avatar Den-dp commented on August 21, 2024

Since the current fix #1113 (removing ts files) is another way of solving #1074, it looks like the changes from #1081 became unnecessary and might be reverted.

Compile-time file resolution should work fine when .js and .d.ts files are placed in the same folder, the problem was only when both .ts, .js and .d.ts are in the same folder.

from alfresco-js-api.

Den-dp avatar Den-dp commented on August 21, 2024

@garth to unblock myself, I used the following postinstall script to remove all .ts (but not .d.ts) files:

package.json

"scripts": {
    "postinstall": "node tools/js-api-fix.js",
}

tools/js-api-fix.js

const glob = require('glob');
const fs = require('fs');

glob('node_modules/@alfresco/js-api/**/!(*.d).ts', (err, files) => {
    if (err) throw err;

    console.log(`Fix @alfresco/js-api package issue: https://github.com/Alfresco/alfresco-js-api/issues/1074`);
    console.log(`Remove ${files.length} *.ts files from directory configured only for typings`);

    files.forEach(file => {
        console.log(`remove "${file}"`);
        fs.unlinkSync(file);
    });
});

Hope it helps

from alfresco-js-api.

garth avatar garth commented on August 21, 2024

@Den-dp, I ran a yarn linked local version for a week or so which was OK for local development, but that was only a very temporary solution. I am now using a variant of 4.4 (linked above) with #1110 PR included. So no need for any post install scripts and all typescript errors are gone.

from alfresco-js-api.

DenysVuika avatar DenysVuika commented on August 21, 2024

Fixed with the latest builds

from alfresco-js-api.

Related Issues (20)

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.