Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid indirect imports in tsconfig.json and package.json #260

Closed
thomaspeugeot opened this issue Jan 29, 2023 · 3 comments
Closed

Avoid indirect imports in tsconfig.json and package.json #260

thomaspeugeot opened this issue Jan 29, 2023 · 3 comments
Assignees

Comments

@thomaspeugeot
Copy link
Contributor

thomaspeugeot commented Jan 29, 2023

Situation:

  • gongc performs a few npm install commands (such as jointjs) at the initialisation because they will be needed by gongdoc
  • gongc adds some import path to the tsconfig.json file because they will be needed by gongdoc, gongleaflet, ...

Problem:

  • those are indirect depedencies and they should not be explicit. For instance, if the dependency in gongdoc changes, all package that depends on gongdoc need to be changed.

Solution:

    "scripts": {
        "install-gongdocdiagrams": "npm install --prefix ../vendor/github.com/fullstack-lang/gongdoc/ng/projects/gongdocdiagrams",
        "postinstall": "npm run install-gongdocdiagrams"
    },

in vendor\github.com\fullstack-lang\gongdoc\ng\projects\gongdocdiagrams\package.json

{
    "name": "gongdocdiagrams",
    "version": "0.0.1",
    "dependencies": {
        "@types/backbone": "^1.4.15",
        "@types/jointjs": "^2.0.0",
        "@types/jquery": "^3.5.16",
        "@types/leaflet": "^1.9.0",
        "@types/lodash": "^4.14.191",
        "backbone": "^1.4.0",
        "install": "^0.13.0",
        "jointjs": "^3.6.5",
        "jquery": "^3.5.1",
        "lodash": "^4.17.20",
        "ng": "file:../../../../../../../ng"
    }
}

problem, it duplicates a full local install and it might be deleted during a go mod vendor command

in the tsconfig.json, add

  "extends": "../vendor/github.com/fullstack-lang/gongdoc/ng/projects/gongdocdiagrams/tsconfig.lib.json",

in the vendor/github.com/fullstack-lang/gongdoc/ng/tsconfig.json

{
  // we cannot extends the global ../../tsconfig.json file because it is not embedded
  "compilerOptions": {
...
    "jointjs": [
      "./node_modules/jointjs"
    ],
...
}

repo github.com\thomaspeugeot\helloworld

has a working configuration

When go mod vendor is performed, it deleted the node_modules directory, therefore a npm install has to be performed again. This is 30' but this is acceptable.

@thomaspeugeot thomaspeugeot changed the title Investigatie wether it is possible to import import paths from another stack to avoid indirect imports path With typescript v5, investigatie wether it is possible to import import paths from another stack to avoid indirect imports path Jan 29, 2023
@thomaspeugeot thomaspeugeot changed the title With typescript v5, investigatie wether it is possible to import import paths from another stack to avoid indirect imports path With typescript v5, avoid avoid indirect imports path in tsconfig.json and package.json Jan 29, 2023
@thomaspeugeot thomaspeugeot self-assigned this Jan 31, 2023
@thomaspeugeot thomaspeugeot changed the title With typescript v5, avoid avoid indirect imports path in tsconfig.json and package.json Avoid indirect imports in tsconfig.json and package.json Feb 2, 2023
@thomaspeugeot
Copy link
Contributor Author

thomaspeugeot commented Feb 3, 2023

OK, there have somme changes to the vendor files and those changed have to be back ported to gongdoc. But right now, there is regression in the helloworld. the material icons are not there anymore.
Investigation.

Maybe this is due to angular 15 and not the mess we performed

@thomaspeugeot
Copy link
Contributor Author

to is due to ng15. There need to be a ng generate @angular/material:mdc-migration command

@thomaspeugeot
Copy link
Contributor Author

does not work on windows. give up issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant