1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["1005"],{1741(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>p,frontMatter:()=>l,contentTitle:()=>s,toc:()=>d,assets:()=>a});var i=JSON.parse('{"id":"introduction/the-projen-workflow","title":"The Projen Workflow","description":"The projen workflow is very simple:","source":"@site/../docs/introduction/the-projen-workflow.md","sourceDirName":"introduction","slug":"/introduction/the-projen-workflow","permalink":"/docs/introduction/the-projen-workflow","draft":false,"unlisted":false,"editUrl":"https://github.com/projen/projen/tree/main/docusaurus/../docs/introduction/the-projen-workflow.md","tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2},"sidebar":"docsSidebar","previous":{"title":"Getting Started","permalink":"/docs/introduction/getting-started"},"next":{"title":"Use Cases","permalink":"/docs/introduction/use-cases"}}'),o=t(4848),r=t(8453);let l={sidebar_position:2},s="The Projen Workflow",a={},d=[{value:"Initializing a project",id:"initializing-a-project",level:2},{value:"Editing configuration",id:"editing-configuration",level:2},{value:"Applying changes",id:"applying-changes",level:2}];function c(e){let n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"the-projen-workflow",children:"The Projen Workflow"})}),"\n",(0,o.jsx)(n.p,{children:"The projen workflow is very simple:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["Initialize a project type using the cli (",(0,o.jsx)(n.code,{children:"pnpm dlx projen new"}),")."]}),"\n",(0,o.jsx)(n.li,{children:"Edit configuration in the .projenrc(.ts/.js/.py/.json) file."}),"\n",(0,o.jsxs)(n.li,{children:["Run ",(0,o.jsx)(n.code,{children:"pnpm projen"})," to apply changes."]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"initializing-a-project",children:"Initializing a project"}),"\n",(0,o.jsxs)(n.p,{children:["Running ",(0,o.jsx)(n.code,{children:"pnpm dlx projen new"})," will initialize the current directory with the new project type specified.\nIf the directory is empty, then the files under control by the project type will be created and\nthe git repository will be initialized with a baseline commit."]}),"\n",(0,o.jsxs)(n.admonition,{type:"warning",children:[(0,o.jsxs)(n.p,{children:['projen allows you to "take over" an existing project.\nA directory does NOT need to be empty to run the ',(0,o.jsx)(n.code,{children:"pnpm dlx projen new"})," command and start a new project.\nHowever, it will overwrite any existing files that are managed by projen.\nMake sure you have all your changes committed before running ",(0,o.jsx)(n.code,{children:"pnpm dlx projen new"}),"."]}),(0,o.jsx)(n.p,{children:"Once you do this, a new git commit will be in your history that shows you all the changes that were made."})]}),"\n",(0,o.jsx)(n.p,{children:"If the directory is not empty, it will overwrite the contents of any files it assumes under its control."}),"\n",(0,o.jsx)(n.p,{children:"Files that are managed by projen are marked as read-only on the file system and should not be edited directly.\nThese files also get a header that indicates that they are managed by projen. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-text",children:'# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".\n'})}),"\n",(0,o.jsx)(n.h2,{id:"editing-configuration",children:"Editing configuration"}),"\n",(0,o.jsx)(n.p,{children:"Over the life of your project you will make changes to the projen configuration by editing the .projenrc(.ts/.js/.py/.json) file. This is just referred to as the 'RC' file.\nIt stores all the configuration and components that define your project.\nAnytime you need to make changes to a file controlled by projen, you will do it by editing this file and\nnever by editing the file directly."}),"\n",(0,o.jsx)(n.h2,{id:"applying-changes",children:"Applying changes"}),"\n",(0,o.jsxs)(n.p,{children:["After making changes, you will run ",(0,o.jsx)(n.code,{children:"pnpm projen"})," to apply the changes.\nprojen will then re-read the RC file and modify any of the files under its control to match the new configuration."]})]})}function p(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},8453(e,n,t){t.d(n,{R:()=>l,x:()=>s});var i=t(6540);let o={},r=i.createContext(o);function l(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.