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

feat: support environments in @slicemachine/plugin-kit, @slicemachine/manager, and adapters (DT-1650, DT-1721) #1182

Merged
merged 35 commits into from
Nov 17, 2023

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Oct 20, 2023

Important

This PR is based on #1160.

Context

DT-1650, DT-1721

The Solution

  • Add two new hooks:
    • project:environment:read
    • project:environment:update
  • Add two new manager methods:
    • manager.project.readEnvironment()
    • manager.project.updateEnvironment()
  • Add two new @slicemachine/plugin-kit/fs helpers:
    • readProjectEnvironment()
    • writeProjectEnvironment()
  • Implement the new hooks in the adapters:
    • @slicemachine/adapter-next
    • @slicemachine/adapter-nuxt
    • @slicemachine/adapter-nuxt2
    • @slicemachine/adapter-sveltekit

Impact / Dependencies

This work will coincide with work on the Slice Machine API.

Checklist before requesting a review

  • I hereby declare my code ready for review.
  • If it is a critical feature, I have added tests.
  • The CI is successful.
  • If there could backward compatibility issues, it has been discussed and planned.

@linear
Copy link

linear bot commented Oct 20, 2023

@vercel
Copy link

vercel bot commented Oct 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
slice-machine ✅ Ready (Inspect) Visit Preview Nov 17, 2023 1:11am

Copy link
Member

@lihbr lihbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a pre-review, but it looks good to me so far :)

For Nuxt it'll be able to work similarly, the environment variable will be: NUXT_PUBLIC_PRISMIC_ENDPOINT

Happy to do it, but if you want to give it a shot, sure thing!

As you said, it'll be nice to abstract the env-reading utils to plugin-kit/fs

packages/plugin-kit/src/createSliceMachinePluginRunner.ts Outdated Show resolved Hide resolved
@angeloashmore angeloashmore changed the base branch from master to dev-next-release October 26, 2023 21:07
@angeloashmore angeloashmore changed the base branch from dev-next-release to aa/dt-1646 October 27, 2023 04:29
@angeloashmore angeloashmore changed the title feat: support environments in @slicemachine/plugin-kit, @slicemachine/manager, and adapters feat: support environments in @slicemachine/plugin-kit, @slicemachine/manager, and adapters (DT-1650, DT-1721) Nov 3, 2023
Copy link

linear bot commented Nov 3, 2023

DT-1721 AADev, I want to use correct types for environments list

After review with platform, we ended up with this structure for environments:

{
    "results": [{
        "kind": "prod",
        "name": "my-test-repo-env",
        "domain": "my-test-repo-env",
        "users": [{ "id": "XxBvdxEAABoAvQ2j" }]
    }, {
        "kind": "stage",
        "name": "Staging",
        "domain": "my-test-repo-env-staging",
        "users": [{ "id": "XxBvdxEAABoAvQ2j" }, { "id": "Xx12UIxhe6WEiOs14" }]
    }]
}

Code that relies on them should be updated accordingly

Copy link
Member

@lihbr lihbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, really nice work!

Base automatically changed from aa/dt-1646 to dev-environments November 17, 2023 01:00
@angeloashmore angeloashmore merged commit 39e4c92 into dev-environments Nov 17, 2023
3 checks passed
@angeloashmore angeloashmore deleted the aa/dt-1650 branch November 17, 2023 01:02
@angeloashmore
Copy link
Member Author

Will be merged into a separate PR.

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

Successfully merging this pull request may close these issues.

3 participants