Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ async function getComponentOptions() {
name: 'hyphenatedName',
message: 'What would you like to name your component? Use hyphenation instead of camelcase. Do not include the d2l prefix.'
},
{
type: 'select',
name: 'org',
message: 'Which GitHub org will this repo be in?',
choices: [
{ title: 'Brightspace', value: 'Brightspace' },
{ title: 'BrightspaceUI', value: 'BrightspaceUI' }
]
},
{
type: 'text',
name: 'description',
Expand All @@ -101,7 +92,7 @@ async function getComponentOptions() {
{
type: 'text',
name: 'codeowners',
message: 'What is/are the GitHub username(s) of the codeowner(s)? (e.g., @janesmith, @johnsmith)'
message: 'What is the GitHub team that will be CODEOWNERS? (e.g., @Brightspace/team-name)'
},
{
type: 'select',
Expand Down Expand Up @@ -170,10 +161,7 @@ async function executeComponentGenerator() {
options.hyphenatedName = options.hyphenatedName.toLowerCase();
options.className = getClassName(options.hyphenatedName);
options.tagName = `d2l-${options.hyphenatedName}`;

options.githubOrg = options.org;
options.orgName = options.org === 'BrightspaceUI' ? '@brightspace-ui' : '@d2l';
options.packageName = `${options.orgName}/${options.hyphenatedName}`;
options.packageName = `@d2l/${options.hyphenatedName}`;

setupDefaultContent(options);
setupElement(options);
Expand Down
12 changes: 0 additions & 12 deletions src/generators/default-content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ export function run(templateData) {
replaceText(`${getDestinationPath(templateData.hyphenatedName)}/package.json`, replacementsPackage);

const replacementsREADME = templateData;
replacementsREADME.labsChecklist = templateData.org === 'labs' ? `\n> Note: this is a ["labs" component](https://daylight.d2l.dev/developing/getting-started/component-tiers/). While functional, these tasks are prerequisites to promotion to BrightspaceUI "official" status:
>
> - [ ] [Design organization buy-in](https://daylight.d2l.dev/developing/creating-component/before-building/#working-with-design)
> - [ ] [Architectural sign-off](https://daylight.d2l.dev/developing/creating-component/before-building/#web-component-architecture)
> - [ ] [Continuous integration](https://daylight.d2l.dev/developing/testing/tools/#continuous-integration)
> - [ ] [Cross-browser testing](https://daylight.d2l.dev/developing/testing/cross-browser/)
> - [ ] [Unit tests](https://daylight.d2l.dev/developing/testing/tools/) (if applicable)
> - [ ] [Accessibility tests](https://daylight.d2l.dev/developing/testing/accessibility/)
> - [ ] [Visual diff tests](https://daylight.d2l.dev/developing/testing/visual-difference/)
> - [ ] Localization with Serge (if applicable)
> - [ ] Demo page
> - [ ] README documentation\n` : '';

if (templateData.description) replacementsREADME.description = `\n${templateData.description}\n`;
copyFile(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# <%= packageName %>

[![NPM version](https://img.shields.io/npm/v/<%= packageName %>.svg)](https://www.npmjs.org/package/<%= packageName %>)
<%= labsChecklist %><%= description %>
<%= description %>
## Installation

Install from NPM:
Install from CodeArtifact:

```shell
npm install <%= packageName %>
Expand Down
2 changes: 2 additions & 0 deletions src/generators/default-content/templates/configured/_npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
registry=https://npm.package-registry.brightspace.com/
ignore-scripts=true
@d2l:registry=https://d2l-569998014834.d.codeartifact.us-east-1.amazonaws.com/npm/private/
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "<%= packageName %>",
"description": "<%= description %>",
"type": "module",
"repository": "https://github.com/<%= githubOrg %>/<%= hyphenatedName %>.git",
"repository": "https://github.com/Brightspace/<%= hyphenatedName %>.git",
"scripts": {
"lint": "npm run lint:eslint && npm run lint:style",
"lint:eslint": "eslint .",
Expand All @@ -18,8 +18,5 @@
},
"files": [
"<%= hyphenatedName %>.js"<%= locales %>
],
"publishConfig": {
"access": "public"
}
]
}
2 changes: 1 addition & 1 deletion src/generators/demo/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"start": "web-dev-server --app-index demo/index.html --node-resolve --open --watch"
},
"devDependencies": {
"@web/dev-server": "^0.4"
"@web/dev-server": "^1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ jobs:
with:
node-version-file: .nvmrc
d2l-registry-token: ${{ secrets.D2L_PACKAGE_REGISTRY_AUTH_TOKEN }}
- name: Get CodeArtifact authorization token
uses: Brightspace/codeartifact-actions/get-authorization-token@main
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_SESSION_TOKEN: ${{secrets.AWS_SESSION_TOKEN}}
- name: Add CodeArtifact npm registry
uses: Brightspace/codeartifact-actions/npm/add-registry@main
with:
auth-token: ${{env.CODEARTIFACT_AUTH_TOKEN}}
- name: Semantic Release
uses: BrightspaceUI/actions/semantic-release@main
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
GITHUB_TOKEN: ${{ secrets.D2L_RELEASE_TOKEN }}
NPM: true