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

TODOs to finish packem #2

Open
23 of 42 tasks
prisis opened this issue May 24, 2024 · 12 comments
Open
23 of 42 tasks

TODOs to finish packem #2

prisis opened this issue May 24, 2024 · 12 comments
Labels
enhancement New feature or request

Comments

@prisis
Copy link
Contributor

prisis commented May 24, 2024

TODOs:

  • Watch Mode
  • D.TS generation
  • Style
    • less
    • sass
    • css
    • css.module
    • url
  • let the user choose between swc, esbuild and sucrase as transformer
  • commands
    • create migration command to migrate from tsup etc.
    • create a init command, to setup the "packem.config.ts" file and transformer
    • add validation command for package.js and types
      • used publint core
      • used arethetypeswrong
    • add a prepare command, that check the source folder for Exports (with a interactive mode)
  • Support jsx/tsx
  • aliases
  • Auto preset
    • Multiple Runtime
      • react-native
      • react-server
      • edge-light
    • Env
  • Tests
  • Docs
  • Remove jsx attributes on config
const Tr = () => (<tr data-testid="test" data-test="test" />);

export default Tr;
  • wasm
  • Support preserve directives like "use client"
  • Add support for cjs interop for default and named export
  • check source map
  • Add file cache for some plugins

Plugins

Typescript

TypeScript supports some additional features in its resolver on top of the Node resolution algorithm. These are configured in tsconfig.json.

baseUrl - a root directory from which to resolve non-relative paths, in addition to node_modules.
paths - additional directories, relative to baseUrl, that should also be searched.
rootDirs - virtual directories that relative paths can be resolved from
@prisis prisis added the enhancement New feature or request label May 24, 2024
@prisis
Copy link
Contributor Author

prisis commented Jun 5, 2024

  • Map package.json exports with .cjs or .mjs to the correct file, if .cts exist map it with .cjs and if .mts exists map it to .mjs else take .ts

@prisis
Copy link
Contributor Author

prisis commented Aug 1, 2024

  • Check cache handling of the commonjs plugin, add a test to validate that it does not break on the second run, check @visulima/path package

@prisis
Copy link
Contributor Author

prisis commented Aug 1, 2024

  • The licence plugin should remove the placeholders if a licence file is important from a different package that uses the same placeholders.

@prisis
Copy link
Contributor Author

prisis commented Aug 4, 2024

  • Prefer publishConfig from package.json when defined

I'd like to use the src/ dir (i.e., TS) vs. dist/ (i.e., JS) when using the package within the monorepo via the workspace: protocol. Essentially, I want to be able to define a different config when not published, relying on pnpm's publishConfig to do the overrides when I publish to the npm registry:

    "publishConfig": {
        "type": "module",
        "exports": {
            ".": {
                "types": "./dist/index.d.ts",
                "require": "./dist/index.js",
                "import": "./dist/index.mjs"
            }
        },
        "main": "./dist/index.js",
        "module": "./dist/index.mjs",
        "types": "./dist/index.d.ts"
    },
    "main": "./src/index.ts",

@prisis
Copy link
Contributor Author

prisis commented Aug 4, 2024

  • improve speed with workers looks like this is not possible with the current design

@prisis
Copy link
Contributor Author

prisis commented Aug 30, 2024

  • fix swc transformer usage

@prisis
Copy link
Contributor Author

prisis commented Aug 31, 2024

  • add isolated declaration to the init command

@visulima visulima deleted a comment from github-actions bot Sep 1, 2024
@prisis
Copy link
Contributor Author

prisis commented Sep 7, 2024

  • add support for node10 type resolution
  • Allow to generate types only

@prisis
Copy link
Contributor Author

prisis commented Sep 9, 2024

  • Add a validation for the package.json
    • it should validate all fields that are needed to publish a package
    • it should validate if the provided fields when "auto" preset is used are correct
    • Should validate the exports field with all values -> Array/Object

@prisis
Copy link
Contributor Author

prisis commented Sep 9, 2024

  • add tests for monorepo use

@prisis
Copy link
Contributor Author

prisis commented Sep 11, 2024

  • watch mode
    • remove files from the internal entry array if the file was deleted on the watch mode didnt find a way to do it
    • add new files into the new internal entry array it the a file was created didnt find a way to do it

@prisis
Copy link
Contributor Author

prisis commented Sep 16, 2024

  • add support for workers
worker = new Worker(new URL("./worker.js", import.meta.url), { type: "module" });
// or simply:
worker = new Worker("./worker.js", { type: "module" });

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

No branches or pull requests

1 participant