diff --git a/.github/workflows/rollingversions-canary.yml b/.github/workflows/rollingversions-canary.yml deleted file mode 100644 index 3fe8e91b1..000000000 --- a/.github/workflows/rollingversions-canary.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish Canary - -on: - push: - branches: - - master - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn install --frozen-lockfile - - run: yarn prettier:check - - run: yarn test - - publish-canary: - runs-on: ubuntu-latest - needs: test - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12.x - registry-url: 'https://registry.npmjs.org' - - run: yarn install --frozen-lockfile - - run: yarn build - - run: npx rollingversions publish --canary $GITHUB_RUN_NUMBER - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/rollingversions.yml b/.github/workflows/rollingversions.yml index 441206aa5..145e647fb 100644 --- a/.github/workflows/rollingversions.yml +++ b/.github/workflows/rollingversions.yml @@ -1,5 +1,8 @@ name: Release on: + push: + branches: + - master repository_dispatch: types: [rollingversions_publish_approved] @@ -21,18 +24,35 @@ jobs: - run: yarn prettier:check - run: yarn test + + publish-canary: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' }} + needs: test + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 24.x + registry-url: 'https://registry.npmjs.org' + - run: yarn install --frozen-lockfile + - run: yarn build + - run: npx rollingversions publish --canary $GITHUB_RUN_NUMBER + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish: runs-on: ubuntu-latest + if: ${{ github.event_name == 'repository_dispatch' }} needs: test steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 24.x registry-url: 'https://registry.npmjs.org' - run: yarn install --frozen-lockfile - run: yarn build - run: npx rollingversions publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/packages/pug-code-gen/index.js b/packages/pug-code-gen/index.js index 3e6bf3b27..738b8f7cf 100644 --- a/packages/pug-code-gen/index.js +++ b/packages/pug-code-gen/index.js @@ -72,8 +72,8 @@ function Compiler(node, options) { ); } if ( - this.doctype && - (this.doctype.includes('<') || this.doctype.includes('>')) + this.options.doctype && + (this.options.doctype.includes('<') || this.options.doctype.includes('>')) ) { throw new Error('Doctype can not contain "<" or ">"'); } @@ -209,7 +209,9 @@ Compiler.prototype = { */ setDoctype: function(name) { - this.doctype = doctypes[name.toLowerCase()] || ''; + this.doctype = doctypes.hasOwnProperty(name.toLowerCase()) + ? doctypes[name.toLowerCase()] + : ''; this.terse = this.doctype.toLowerCase() == ''; this.xml = 0 == this.doctype.indexOf('